Errore di configurazione dell'amministratore: indice indefinito: id in Iterator.php sulla riga 59


16

Qualcuno può spiegarmi questo errore?

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}

Ciao, hai installato una nuova estensione?
— Meetanshi,

Potrebbe esserci un errore nel modulo xml (system.xml, acl.xml, ecc.) Incollare il codice se possibile.
— Chander Shekhar

Avere lo stesso problema, dopo l'installazione dell'estensione github.com/mageplaza/magento-2-better-popup tramite download. Ma quando si installa tramite compositore funziona benissimo. Ho bisogno di cambiare la sua funzionalità ed è per questo che non è possibile installarlo dal compositore. Qualcuno ha risolto questo?
— Ajwad Syed

Risposte:


30

Ho riscontrato un problema simile e, nel mio caso, il problema era dovuto al fatto che l'ID della scheda non era corretto 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>

Per risolvere il problema, ho cambiato
<tab>customtab</tab>
a
<tab>custom_tab</tab>


Ciao @Anshu Mishra, la risposta di cui sopra è stata utile per me, ma quando disattivo il modulo dal lato amministratore non mi viene meno.
— shivashankar m,

7

Un modo semplice per eseguire il debug è: sfogliare e aprire il fornitore / magento / module-config / Model / Config / Structure / Element / Iterator.php

modificare

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

per

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'];
        }
    }

Ricarica la finestra di configurazione del browser e visualizza nuovamente l'errore.

Controlla il file var / log / config_debug.log.

Vai in fondo al file e vedi quale modulo non è riuscito, dove si è fermato.

Questo è quello che causa i tuoi problemi.

Non dimenticare di ripristinare le modifiche una volta risolte.


5

Nel mio caso l'errore generato perché la scheda è stata definita nel modulo che è disabilitata, ma utilizzata in un altro modulo che è abilitato. Quindi, ti consiglio di controllare quale scheda non ha idnella classe specificata:

esempio di debug

Quindi, cerca quel nome per intero progetto (nel system.xmlfile) e controlla che quel modulo sia abilitato.

PS : non c'è nessun errore nello screenshot, ma in realtà è stato attivato dal DeliveryTimemodulo, perché il Coremodulo è stato disabilitato quando ho provato ad accedere alla pagina di configurazione dell'archivio.


3

Nel mio caso, ho installato https://www.mageplaza.com/magento-2store-credit/ estensione, ma non ha installato modulo di base di Mageplaza.

Ho scoperto che <tab>mageplaza</tab>menzionato in system.xmlma la scheda non è definita in questo file. Quindi, il modulo di base installato per Mageplaza da https://github.com/mageplaza/module-core e funziona benissimo.


Grazie @nalin savaliya
— Pradip Garchar

Lo stesso qui, tranne per il fatto che avevo installato il modulo tramite Composer, ma non era abilitato. bin/magento module:enable Mageplaza_Corerisolto quello.
— Thomas Luzat,

1

Ho anche affrontato questo problema in magento2. Questo è il mio file system.xml


<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

Questo problema si presenta a causa di system.xml. Correggi come indicato di seguito, la tua scheda di sistema id = " custom_tab " translate = "label" sortOrder = "10"> E il nome della scheda nella sezione dovrebbe essere lo stesso.

Utilizzando il nostro sito, riconosci di aver letto e compreso le nostre Informativa sui cookie e Informativa sulla privacy.
Licensed under cc by-sa 3.0 with attribution required.