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

Feature Request: config:set global #955

Open
tylers-username opened this issue Oct 24, 2017 · 7 comments
Open

Feature Request: config:set global #955

tylers-username opened this issue Oct 24, 2017 · 7 comments

Comments

@tylers-username
Copy link

It would be nice to update all values for a setting, regardless of scope.

Something like: magerun config:set path/to/setting value --global

@cmuench
Copy link
Member

cmuench commented Oct 24, 2017

@tylerssn What is the difference between?

magerun config:set path/to/setting value --global

and

magerun config:set path/to/setting value

@tylers-username
Copy link
Author

tylers-username commented Oct 24, 2017

My understanding is that magerun config:set path/to/setting value updates the default scope. If the website and store scope have a different value than default, they will not inherit the new value. --global could either (1) force the values to update at each scope or (2) set the default scope and delete the website and store scopes so that they can inherit the value.

@cmuench
Copy link
Member

cmuench commented Oct 24, 2017

If only need the "global" value, you can set the scope-id to zero. That's the default.

@tylers-username
Copy link
Author

Right, but this does not update the store and website scope. Here is my use case:

When deploying a dev environment, I do not want to disable my cron but I do want to disable specific cron enable/disable settings.

I'm providing JSON in the format of:

{
    "cron/setting/enable": 0,
    "other/system/setting": 0
}

This is then parsed in a foreach when deploying my dev environment: magerun config:set {$key} {$value}

Let's say I have these Magento configuration settings:

Store Specific Cron Jobs:

  • cron/setting/enable: true (store x)
  • cron/setting/enable: false (store y)
  • cron/setting/enable: true (website x)
  • cron/setting/enable: true (default scope)
  • cron/setting/enable: false (store z)
  • cron/setting/enable: true (website y) [inherited]

If I run magerun config:set cron/setting/enable 0, the default scope is now false and will not run, however, the store-level settings remain true.

This is what I do not want:

  • cron/setting/enable: true (store x)
  • cron/setting/enable: false (store y)
  • cron/setting/enable: true (website x)
  • cron/setting/enable: false (default scope)
  • cron/setting/enable: false (store z)
  • cron/setting/enable: false (website y) [inherited]

If I run magerun config:set cron/setting/enable 0 --global, the desired result is that all settings are disabled. The ideal result would be one of the below:

  • cron/setting/enable: false (store x)
  • cron/setting/enable: false (store y)
  • cron/setting/enable: false (website x)
  • cron/setting/enable: false (default scope)
  • cron/setting/enable: false (store z)
  • cron/setting/enable: false (website y) [inherited]

OR

  • cron/setting/enable: false (store x) [inherited]
  • cron/setting/enable: false (store y) [inherited]
  • cron/setting/enable: false (website x) [inherited]
  • cron/setting/enable: false (default scope)
  • cron/setting/enable: false (store z) [inherited]
  • cron/setting/enable: false (website y) [inherited]

@cmuench
Copy link
Member

cmuench commented Oct 24, 2017

@tylerssn ok, Now i know what you are meaning. The name "global" was a little bit misleading for me. The term "global scope" also exists.

The feature is more a "set a value in global scope and delete all store-view values".

@tylers-username
Copy link
Author

@cmuench - I am sure M1 babysitting is not at the top of our Magerun to-do list, however, do you plan on taking any action to ensure inheritance works on set values?

At the moment if I magerun config:delete wordpress/database/host --all --force and then magerun config:set wordpress/database/host db-host, the default setting is applied, however, in the admin UI the scopes that should be inheriting are blank.

@cmuench
Copy link
Member

cmuench commented Feb 8, 2018

@tylerson You are right. In the last year the count of M1 Projects at netz98 decreased dramatically. Most of our projects are M2.
I think we can implement this feature. I have an overdue n98-magerun release for M1 on my to-do list.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants