태그 보관물: xml

xml

관리자 구성 오류 : 정의되지 않은 색인 : 59 행의 Iterator.php에있는 id /home/staging/vendor/magento/framework/Interception/Chain/Chain.php(70): Magento\Config\Controller\Adminhtml\System\Config\Index\Interceptor->___callParent(‘dispatch’, Array)

누군가 나 에게이 오류를 설명해 주시겠습니까?

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}



답변

비슷한 문제에 직면했으며 내 경우에는 잘못된 탭 ID 일치로 인해 문제가 발생했습니다. 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>

이 문제를 해결하려면, 나는 변화
<tab>customtab</tab>

<tab>custom_tab</tab>


답변

쉽게 디버그하는 방법은 vendor / magento / module-config / Model / Config / Structure / Element / Iterator.php를 찾아서 여는 것입니다.

변화

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

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

브라우저 구성 창을 다시로드하고 오류를 다시 확인하십시오.

var / log / config_debug.log 파일을 확인하십시오.

파일의 맨 아래로 이동하여 어떤 모듈이 실패했는지 확인하십시오.

그것이 문제를 일으키는 원인입니다.

수정 된 변경 사항을 롤백하는 것을 잊지 마십시오.


답변

필자의 경우 이 비활성화 된 모듈에서 정의되었지만 활성화 된 다른 모듈에서 사용 되었기 때문에 오류가 발생했습니다 . 따라서 id지정된 클래스에 없는 탭을 확인하는 것이 좋습니다 .

디버그 예

그런 다음 system.xml파일 에서 전체 프로젝트별로 해당 이름을 검색하고 해당 모듈이 활성화되어 있는지 확인하십시오.

추신 : 스크린 샷에는 오류가 없지만 실제로 상점 구성 페이지에 액세스하려고 할 때 모듈이 비활성화 DeliveryTime되었기 때문에 Core모듈에 의해 발생했습니다 .


답변

내 경우에는, 내가 설치 한 https://www.mageplaza.com/magento-2store-credit/ 확장을하지만, Mageplaza의 핵심 모듈을 설치하지 않았다.

나는 것을 발견 <tab>mageplaza</tab>에 mentined system.xml하지만 탭이이 파일에 정의되어 있지 않습니다. 따라서 https://github.com/mageplaza/module-core 에서 Mageplaza의 핵심 모듈을 설치
하면 정상적으로 작동합니다.


답변

magento2 에서도이 문제에 직면했습니다. 이것은 내 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"


답변

이 문제는 system.xml로 인해 발생합니다. 아래에 따라 시스템 탭 id = ” custom_tab “translate = “label”sortOrder = “10”>을 수정하고 섹션 아래의 탭 이름이 같아야합니다.


답변