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

'Notice: Undefined index: groups' while executing bin/magento app:config:import #22

Open
hostep opened this issue Jul 31, 2018 · 1 comment

Comments

@hostep
Copy link

hostep commented Jul 31, 2018

Hi guys

I haven't tested this on a clean Magento project, but I think you will probably be able to reproduce it.

This has been seen using Magento EE 2.2.5 on a Magento Cloud environment. We use version 1.0.9 of the DPD module.

Anyway, here's what I've noticed:

  • Our client has done some configuration of the DPD module in the backend of Magento (and probably uploaded a csv file)
  • On the Magento Cloud, it is advised to regularly run vendor/bin/m2-ece-scd-dump to dump the configuration to the app/etc/config.php file (since you guys probably won't have access to the Magento Cloud, you can most likely reproduce this by executing bin/magento app:config:dump)
  • After dumping the config, we have this section in our app/etc/config.php file:
    ...

    'system' => [
        'websites' => [
            'base' => [
                'carriers' => [
                    'dpdpredict' => [
                        'condition_name' => 'package_value',
                        'import' => '1529500591,correct_tablerates.csv,text/csv,/tmp/abcdefghijklmn/phpuMlX6V,0,219'
                    ],
                    'dpdsaturday' => [
                        'condition_name' => 'package_weight',
                        'import' => '1529500591,,,,4,0'
                    ],
                    'dpdpickup' => [
                        'condition_name' => 'package_value',
                        'import' => '1529500591,,,,4,0'
                    ],
                    'tablerate' => [
                        'import' => '1529500591,,,,4,0'
                    ],
                    'dhl' => [
                        'doc_methods' => NULL
                    ]
                ],
            ]
        ]
    ]

    ...
  • Then, when we try to import this config back in Magento on another (or the same) environment using bin/magento app:config:import, we get this output:
$ bin/magento app:config:import
Processing configurations data from configuration file...
Import failed: Notice: Undefined index: groups in vendor/dpdbenelux/magento2-shipping/Model/ResourceModel/Tablerate.php on line 264

Extra remark: I don't think it's a good idea to move these "import" configurations in between environments, since they look like file uploads, so that wouldn't make any sense to move those in between environments. Maybe those "import" configurations should be marked as "system-specific" ? More info: https://devdocs.magento.com/guides/v2.2/extension-dev-guide/configuration/sensitive-and-environment-settings.html (I think this can only be done for Magento 2.2 and higher)

This is probably a pretty complex issue, so I hope I've provided enough info for you guys to figure out what is wrong or what can be improved.

Thanks!

@dpdplugin
Copy link
Contributor

Thank you for reporting this issue and providing so much information!

We've been able to reproduce this issue in a clean testing environment and added it to our backlog to fix in an upcoming release. We agree that the "import" value shouldn't be present in the config.php

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

No branches or pull requests

2 participants