semaio / Magento2-ConfigImportExport

Import/Export configuration data in Magento 2 via CLI.
Open Software License 3.0
157 stars 59 forks source link

Importing fully exported config result in error when run cron #15

Closed tunght13488 closed 7 years ago

tunght13488 commented 7 years ago

General

Issue description

Magneto use a config with path crontab/default/jobs/magento_scheduled_import_export_log_clean/schedule/cron_expr to store the cron schedule of import/export log cleaning schedule options (See \Magento\ScheduledImportExport\Model\System\Config\Backend\Logclean\Cron::CRON_STRING_PATH). This is exported as crontab/default/jobs. Once the exported file is imported, it will basically discard all crontab configuration (defined in crontab.xml of modules) and result in error when attempt to run cron.

Steps to reproduce

  1. In Magento backend, Go to Store > Configuration > Advanced > System
  2. Click save
  3. Export config
  4. Import exported files
  5. Try to run cron (bin/magento cron:run)
  6. See error invalid argument supplied to foreach
ktomk commented 7 years ago

Could you please be so kind and add (exemplary) such an error message (copy & paste would be favourable over a screen-shot). If you have a back-trace, please add it as well, if it contains personal information, please mask / remove it from the output. Thanks for your efforts in advance.

tunght13488 commented 7 years ago

@ktomk I have a PR #16 for this. This error occurred because there are configuration having more than 3 parts (separated by /). E.g: cron/default/etc/etc or system/full_page_cache/varnish/etc

ktomk commented 7 years ago

@tunght13488: Thanks, just saw it. It's now (after the exemplary config data in the PR is outlined) more clear to me what this is about.

ktomk commented 7 years ago

@therouv: You can make a fix release version, one flaw less.

therouv commented 7 years ago

@ktomk Thanks! Just released v2.2.2 :)

ktomk commented 7 years ago

@therouv : Credits go to @tunght13488: as well. He filed the PR, I did the review.