1

I am using Magento 2.3.4. Some product detail page get below error, Please help Thanks in Advance

1 exception(s):
Exception #0 (Magento\Framework\Config\Dom\ValidationException): Element 'reference': This element is not expected.
Line: 1


Exception #0 (Magento\Framework\Config\Dom\ValidationException): Element 'reference': This element is not expected.
Line: 1

<pre>#1 Magento\Framework\Config\Dom->__construct() called at [lib/internal/Magento/Framework/ObjectManager/Factory/AbstractFactory.php:121]
#2 Magento\Framework\ObjectManager\Factory\AbstractFactory->createObject() called at [lib/internal/Magento/Framework/ObjectManager/Factory/Compiled.php:108]
#3 Magento\Framework\ObjectManager\Factory\Compiled->create() called at [lib/internal/Magento/Framework/ObjectManager/ObjectManager.php:56]
#4 Magento\Framework\ObjectManager\ObjectManager->create() called at [lib/internal/Magento/Framework/Config/DomFactory.php:43]
#5 Magento\Framework\Config\DomFactory->createDom() called at [lib/internal/Magento/Framework/View/Model/Layout/Update/Validator.php:141]
#6 Magento\Framework\View\Model\Layout\Update\Validator->isValid() called at [lib/internal/Magento/Framework/View/Model/Layout/Merge.php:512]
#7 Magento\Framework\View\Model\Layout\Merge->_validateMergedLayout() called at [lib/internal/Magento/Framework/View/Model/Layout/Merge.php:488]
#8 Magento\Framework\View\Model\Layout\Merge->load() called at [lib/internal/Magento/Framework/View/Layout/Builder.php:86]
#9 Magento\Framework\View\Layout\Builder->loadLayoutUpdates() called at [lib/internal/Magento/Framework/View/Layout/Builder.php:63]
#10 Magento\Framework\View\Layout\Builder->build() called at [lib/internal/Magento/Framework/View/Layout.php:257]
#11 Magento\Framework\View\Layout->build() called at [lib/internal/Magento/Framework/View/Layout.php:882]
#12 Magento\Framework\View\Layout->getBlock() called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:414]
#13 Magento\Framework\View\Layout\Interceptor->getBlock() called at [app/code/Magento/Cms/Helper/Page.php:215]
#14 Magento\Cms\Helper\Page->prepareResultPage() called at [app/code/Magento/Cms/Controller/Noroute/Index.php:47]
#15 Magento\Cms\Controller\Noroute\Index->execute() called at [lib/internal/Magento/Framework/App/Action/Action.php:108]
#16 Magento\Framework\App\Action\Action->dispatch() called at [lib/internal/Magento/Framework/Interception/Interceptor.php:58]
#17 Magento\Cms\Controller\Noroute\Index\Interceptor->___callParent() called at [lib/internal/Magento/Framework/Interception/Interceptor.php:138]
#18 Magento\Cms\Controller\Noroute\Index\Interceptor->Magento\Framework\Interception\{closure}() called at [lib/internal/Magento/Framework/Interception/Interceptor.php:153]
#19 Magento\Cms\Controller\Noroute\Index\Interceptor->___callPlugins() called at [generated/code/Magento/Cms/Controller/Noroute/Index/Interceptor.php:26]
#20 Magento\Cms\Controller\Noroute\Index\Interceptor->dispatch() called at [lib/internal/Magento/Framework/App/FrontController.php:159]
#21 Magento\Framework\App\FrontController->processRequest() called at [lib/internal/Magento/Framework/App/FrontController.php:98]
#22 Magento\Framework\App\FrontController->dispatch() called at [lib/internal/Magento/Framework/Interception/Interceptor.php:58]
#23 Magento\Framework\App\FrontController\Interceptor->___callParent() called at [lib/internal/Magento/Framework/Interception/Interceptor.php:138]
#24 Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}() called at [app/code/Magento/Store/App/FrontController/Plugin/RequestPreprocessor.php:99]
#25 Magento\Store\App\FrontController\Plugin\RequestPreprocessor->aroundDispatch() called at [lib/internal/Magento/Framework/Interception/Interceptor.php:135]
#26 Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}() called at [app/code/Magento/PageCache/Model/App/FrontController/BuiltinPlugin.php:73]
#27 Magento\PageCache\Model\App\FrontController\BuiltinPlugin->aroundDispatch() called at [lib/internal/Magento/Framework/Interception/Interceptor.php:135]
#28 Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}() called at [lib/internal/Magento/Framework/Interception/Interceptor.php:153]
#29 Magento\Framework\App\FrontController\Interceptor->___callPlugins() called at [generated/code/Magento/Framework/App/FrontController/Interceptor.php:26]
#30 Magento\Framework\App\FrontController\Interceptor->dispatch() called at [lib/internal/Magento/Framework/App/Http.php:116]
#31 Magento\Framework\App\Http->launch() called at [generated/code/Magento/Framework/App/Http/Interceptor.php:24]
#32 Magento\Framework\App\Http\Interceptor->launch() called at [lib/internal/Magento/Framework/App/Bootstrap.php:261]
#33 Magento\Framework\App\Bootstrap->run() called at [pub/index.php:40]
2

THis means you have in one of your layout xml files or in the "Layout Update XML" field for some of your products something like this

<reference .....

This tag is not allowed in the layout files. most probably should be

<referenceBlock ....

or

<referenceContainer ....

Look in your xml files for the text <reference (with a space at the end to avoid false positives) and remove or fix the occurrences.
If it's not in the xmls look in the table catalog_product_entity_text .

1
  • Thanks @Marius for quick respond – bhagwandernase May 11 '20 at 7:29
1

First, checkout the link https://devdocs.magento.com/guides/v2.3/frontend-dev-guide/layouts/layout-types.html

<reference></reference> is a layout tag used at Magento 1. This tag does not support for Magento 2.

In somewhere at your code or database, this tag is exited,. you need to remove those codes/database.

I guess that in your case the issue at your database, some products has those layout.

As mention @marius https://magento.stackexchange.com/a/312436/4564 you need to go to Layout Update XML tab your code product at admin and removed those code.

It will resolve your issue.

2

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.