Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Settings does not exist #4

Closed
AVATOR opened this issue Feb 17, 2017 · 4 comments
Closed

Settings does not exist #4

AVATOR opened this issue Feb 17, 2017 · 4 comments
Labels

Comments

@AVATOR
Copy link
Contributor

AVATOR commented Feb 17, 2017

Hi.
I try to get data by "name" which doesn't exist and get error
Error: Call to a member function getValue() on null

Please, return "" if settings don't exist.

@lexxpavlov
Copy link
Owner

I don't think that settings may be dynamic. If you need with concrete setting, than create it. I supposed
that settings will use as static rarely changed values.

How do you plan to use settings so that it can be null?

@AVATOR
Copy link
Contributor Author

AVATOR commented Feb 19, 2017

I work with Magento and it return "" if setting can not find.
Example:
I create setting "heder_phone". Web-site will stop work if manager accidentally deleted a setting.

@lexxpavlov
Copy link
Owner

It's really bug. I will fix soon.

You can configure SonataAdminBundle that manager can't delete setting (superadmin can everything):

# app/config/config.yml
sonata_admin:
    security:
        handler: sonata.admin.security.handler.role

# app/config/security.yml
security:
    role_hierarchy:
        ROLE_SONATA_MANAGER:
            - ROLE_APP_ADMIN_ARTICLE_ALL
            - ROLE_LEXXPAVLOV_SONATA_ADMIN_SETTINGS_LIST
            - ROLE_LEXXPAVLOV_SONATA_ADMIN_SETTINGS_EDIT
            - ROLE_LEXXPAVLOV_SONATA_ADMIN_SETTINGS_SHOW
#            - ROLE_APP_ADMIN_USER_ALL

        ROLE_ADMIN:       [ ROLE_USER, ROLE_SONATA_ADMIN ]
        ROLE_MANAGER:     [ ROLE_ADMIN, ROLE_SONATA_MANAGER ]
        ROLE_SUPER_ADMIN: [ ROLE_MANAGER, ROLE_ALLOWED_TO_SWITCH ]

See security docs.

AVATOR pushed a commit to AVATOR/LexxpavlovSettingsBundle that referenced this issue Mar 30, 2017
@AVATOR
Copy link
Contributor Author

AVATOR commented Mar 30, 2017

I have created pull request #5

AVATOR pushed a commit to AVATOR/LexxpavlovSettingsBundle that referenced this issue Mar 31, 2017
lexxpavlov added a commit that referenced this issue Mar 31, 2017
#4 Settings does not exist
@AVATOR AVATOR closed this as completed Mar 31, 2017
@lexxpavlov lexxpavlov added the bug label Jul 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants