13

Can someone please explain this error to me?

Exception #0 (Exception): Notice: Undefined index: id in /home/staging/vendor/magento/module-config/Model/Config/Structure/Element/Iterator.php on line 59
    #0 /home/staging/vendor/magento/module-config/Model/Config/Structure/Element/Iterator.php(59): Magento\Framework\App\ErrorHandler->handler(8, 'Undefined index...', '/home/asconveyo...', 59, Array)
    #1 /home/staging/vendor/magento/module-config/Model/Config/Structure.php(92): Magento\Config\Model\Config\Structure\Element\Iterator->setElements(Array, 'default')
    #2 /home/staging/var/generation/Magento/Config/Model/Config/Structure/Interceptor.php(24): Magento\Config\Model\Config\Structure->getTabs()
    #3 /home/staging/vendor/magento/module-config/Model/Config/Structure.php(135): Magento\Config\Model\Config\Structure\Interceptor->getTabs()
    #4 /home/staging/var/generation/Magento/Config/Model/Config/Structure/Interceptor.php(63): Magento\Config\Model\Config\Structure->getFirstSection()
    #5 /home/staging/vendor/magento/module-config/Controller/Adminhtml/System/AbstractConfig.php(57): Magento\Config\Model\Config\Structure\Interceptor->getFirstSection()
    #6 /home/staging/vendor/magento/framework/Interception/Interceptor.php(74): Magento\Config\Controller\Adminhtml\System\AbstractConfig->dispatch(Object(Magento\Framework\App\Request\Http))
    #7 /home/staging/vendor/magento/framework/Interception/Chain/Chain.php(70): Magento\Config\Controller\Adminhtml\System\Config\Index\Interceptor->___callParent('dispatch', Array)
    #8 /home/staging/vendor/magento/framework/Interception/Chain/Chain.php(63): Magento\Framework\Interception\Chain\Chain->invokeNext('Magento\\Config\\...', 'dispatch', Object(Magento\Config\Controller\Adminhtml\System\Config\Index\Interceptor), Array, 'adminAuthentica...')
    #9 /home/staging/vendor/magento/module-backend/App/Action/Plugin/Authentication.php(143): Magento\Framework\Interception\Chain\Chain->Magento\Framework\Interception\Chain\{closure}(Object(Magento\Framework\App\Request\Http))
    #10 /home/staging/vendor/magento/framework/Interception/Chain/Chain.php(67): Magento\Backend\App\Action\Plugin\Authentication->aroundDispatch(Object(Magento\Config\Controller\Adminhtml\System\Config\Index\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))
    #11 /home/staging/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Framework\Interception\Chain\Chain->invokeNext('Magento\\Config\\...', 'dispatch', Object(Magento\Config\Controller\Adminhtml\System\Config\Index\Interceptor), Array, 'adminMassaction...')
    #12 /home/staging/vendor/magento/module-backend/App/Action/Plugin/MassactionKey.php(33): Magento\Config\Controller\Adminhtml\System\Config\Index\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Request\Http))
    #13 /home/staging/vendor/magento/framework/Interception/Interceptor.php(142): Magento\Backend\App\Action\Plugin\MassactionKey->aroundDispatch(Object(Magento\Config\Controller\Adminhtml\System\Config\Index\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))
    #14 /home/staging/var/generation/Magento/Config/Controller/Adminhtml/System/Config/Index/Interceptor.php(39): Magento\Config\Controller\Adminhtml\System\Config\Index\Interceptor->___callPlugins('dispatch', Array, Array)
    #15 /home/staging/vendor/magento/framework/App/FrontController.php(55): Magento\Config\Controller\Adminhtml\System\Config\Index\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))
    #16 /home/staging/vendor/magento/framework/Interception/Interceptor.php(74): Magento\Framework\App\FrontController->dispatch(Object(Magento\Framework\App\Request\Http))
    #17 /home/staging/vendor/magento/framework/Interception/Chain/Chain.php(70): Magento\Framework\App\FrontController\Interceptor->___callParent('dispatch', Array)
    #18 /home/staging/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Framework\Interception\Chain\Chain->invokeNext('Magento\\Framewo...', 'dispatch', Object(Magento\Framework\App\FrontController\Interceptor), Array, 'install')
    #19 /home/staging/vendor/magento/framework/Module/Plugin/DbStatusValidator.php(69): Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Request\Http))
    #20 /home/staging/vendor/magento/framework/Interception/Interceptor.php(142): Magento\Framework\Module\Plugin\DbStatusValidator->aroundDispatch(Object(Magento\Framework\App\FrontController\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))
    #21 /home/staging/var/generation/Magento/Framework/App/FrontController/Interceptor.php(26): Magento\Framework\App\FrontController\Interceptor->___callPlugins('dispatch', Array, Array)
    #22 /home/staging/vendor/magento/framework/App/Http.php(135): Magento\Framework\App\FrontController\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))
    #23 /home/staging/vendor/magento/framework/App/Bootstrap.php(258): Magento\Framework\App\Http->launch()
    #24 /home/staging/index.php(42): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http))
    #25 {main}
  • Hi, Have you installed any new extension? – Meetanshi Nov 22 '17 at 8:52
  • May be error in your module xml(system.xml, acl.xml, etc..) paste your code if you can. – Chander Shekhar Nov 22 '17 at 8:56
  • Having same issue, after installing github.com/mageplaza/magento-2-better-popup extension by downloading. But when install via composer it works fine. I need to change its functionality that is why can not install by composer. Anybody have solve this ? – Ajwad Syed Nov 14 '18 at 9:33
27

I have faced a similar issue and in my case, the issue was because I have incorrect tab id matching in system.xml

<tab id="custom_tab" translate="label" sortOrder="2000">
            <label>Custom Tab</label>
        </tab>
        <section id="custom_section" translate="label" type="text" sortOrder="40" showInDefault="1" showInWebsite="1" showInStore="1">
            <class>separator-top</class>
            <label>Custom Section</label>
            <tab>customtab</tab>

To fix the issue, I changed
<tab>customtab</tab>
to
<tab>custom_tab</tab>

  • Hi @Anshu Mishra the above answer is helped for me, but when i disble the module from admin side its not disablinhg. – shivashankar m Dec 28 '18 at 6:41
5

In my case the error thrown because the tab was defined in the module which is disabled, but used in another module which is enabled. So, I recommend you to check which tab have no id in the specified class:

debug example

Then, search that name by entire project (in the system.xml file) and check is that module enabled.

PS: there is no error on the screenshot, but actually it was fired by the DeliveryTime module, because Core module was disabled when I tried to access store configuration page.

5

One easy way to debug is: browse and open vendor/magento/module-config/Model/Config/Structure/Element/Iterator.php

change

public function setElements(array $elements, $scope)
    {
        $this->_elements = $elements;
        $this->_scope = $scope;
        if (count($elements)) {
            $lastElement = end($elements);
            $this->_lastId = $lastElement['id'];
        }
    }

to

public function setElements(array $elements, $scope)
    {
        $writer = new \Zend\Log\Writer\Stream(BP . '/var/log/config_debug.log');
        $logger = new \Zend\Log\Logger();
        $logger->addWriter($writer);

        $this->_elements = $elements;
        $this->_scope = $scope;

        $logger->info($elements);

        if (count($elements)) {
            $lastElement = end($elements);
            $this->_lastId = $lastElement['id'];
        }
    }

Reload browser configuration window and see once again the error.

Check var/log/config_debug.log file.

Go to very bottom of the file and see which module failed, where it stopped.

That's the one causing your issues.

Don't forget to rollback your changes once fixed.

2

In my case, I have installed ​ https://www.mageplaza.com/magento-2store-credit/ extension, but did not installed core module of Mageplaza.

I found that <tab>mageplaza</tab> mentined in system.xml but tab is not defined in this file. So, installed core module for Mageplaza from https://github.com/mageplaza/module-core and it's working fine.

1

I have also face this issue in magento2. This is my system.xml file


<tab id="cnet" translate="label" sortOrder="10">
            <label>CNET</label>
        </tab>
        <section id="cnet" translate="label" sortOrder="130" showInDefault="1" showInWebsite="1" showInStore="1">
            <class>separator-top</class>
            <label>General Information</label>
            <tab>cnet</tab>
Please change tab id = "cnet" and <tab>cnet</tab>.
If its not matching error will be occur. After change this one run the "sudo php bin/magento setup:di:compile"
0

This issue is coming because of system.xml. Please correct as per below, your system tab id="custom_tab" translate="label" sortOrder="10"> And tab name under section should be same.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.