5

I am on Magento 2.2.3. I tried to install the Ultimo theme and got this error. I realized it would not work for me. I went ahead and removed the theme and now receive this-

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

#0 /var/www/html/vendor/magento/framework/Config/Dom.php(115): Magento\Framework\Config\Dom->_initDom('<layout xmlns:x...')
#1 /var/www/html/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(111): Magento\Framework\Config\Dom->__construct('<layout xmlns:x...', Object(Magento\Framework\App\Arguments\ValidationState), Array, NULL, '/var/www/html/w...', '%message%\nLine:...')
#2 /var/www/html/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(66): Magento\Framework\ObjectManager\Factory\AbstractFactory->createObject('Magento\\Framewo...', Array)
#3 /var/www/html/vendor/magento/framework/ObjectManager/ObjectManager.php(56): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('Magento\\Framewo...', Array)
#4 /var/www/html/vendor/magento/framework/Config/DomFactory.php(42): Magento\Framework\ObjectManager\ObjectManager->create('Magento\\Framewo...', Array)
#5 /var/www/html/vendor/magento/framework/View/Model/Layout/Update/Validator.php(141): Magento\Framework\Config\DomFactory->createDom(Array)
#6 /var/www/html/vendor/magento/framework/View/Model/Layout/Merge.php(461): Magento\Framework\View\Model\Layout\Update\Validator->isValid('<layout xmlns:x...', 'layout_merged', false)
#7 /var/www/html/vendor/magento/framework/View/Model/Layout/Merge.php(442): Magento\Framework\View\Model\Layout\Merge->_validateMergedLayout('LAYOUT_frontend...', '<reference name...')
#8 /var/www/html/generated/code/Magento/Framework/View/Model/Layout/Merge/Interceptor.php(193): Magento\Framework\View\Model\Layout\Merge->load(Array)
#9 /var/www/html/vendor/magento/framework/View/Layout/Builder.php(86): Magento\Framework\View\Model\Layout\Merge\Interceptor->load()
#10 /var/www/html/vendor/magento/framework/View/Layout/Builder.php(63): Magento\Framework\View\Layout\Builder->loadLayoutUpdates()
#11 /var/www/html/vendor/magento/framework/View/Layout.php(254): Magento\Framework\View\Layout\Builder->build()
#12 /var/www/html/vendor/magento/framework/View/Layout.php(875): Magento\Framework\View\Layout->build()
#13 /var/www/html/generated/code/Magento/Framework/View/Layout/Interceptor.php(414): Magento\Framework\View\Layout->getBlock('page_content_he...')
#14 /var/www/html/vendor/magento/module-cms/Helper/Page.php(171): Magento\Framework\View\Layout\Interceptor->getBlock('page_content_he...')
#15 /var/www/html/vendor/magento/module-cms/Controller/Index/Index.php(43): Magento\Cms\Helper\Page->prepareResultPage(Object(Magento\Cms\Controller\Index\Index\Interceptor), 'new-home')
#16 /var/www/html/generated/code/Magento/Cms/Controller/Index/Index/Interceptor.php(24): Magento\Cms\Controller\Index\Index->execute(NULL)
#17 /var/www/html/vendor/magento/framework/App/Action/Action.php(107): Magento\Cms\Controller\Index\Index\Interceptor->execute()
#18 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Framework\App\Action\Action->dispatch(Object(Magento\Framework\App\Request\Http))
#19 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Cms\Controller\Index\Index\Interceptor->___callParent('dispatch', Array)
#20 /var/www/html/vendor/magento/module-customer-segment/Model/App/Action/ContextPlugin.php(81): Magento\Cms\Controller\Index\Index\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Request\Http))

I only receive it in developer mode, in production mode everything works fine. This is the issue- https://github.com/magento/magento2/issues/11194#issuecomment-333978626 what I can't find is where the 'reference' is. How do I locate it?

3

This error indicates that somewhere in your XML layout files you have element <reference/>, which is not allowed. You can search for all occurrences of '<reference ' in your /app folder (*.xml).

If you can't find it, then it is possible that you have entered <reference> element in admin in XML Layout update field somewhere (Category, CMS Page, etc.), in this case you'll only get error on that page / category. If you have error on Home page, check 'Layout Update XML' field for Page with 'home' URL key.

| improve this answer | |
0

After removed the Ultimo theme you need to run the below ssh commands in your magento root directory:

rm -rf var/*
rm -rf pub/static/*
php bin/magento setup:upgrade
php bin/magento setup:static-content:deploy
chmod -R 777 var pub/static
php bin/magento cache:flush

I hope it will work.

| improve this answer | |
  • Went through and I still got the same error. I need to open up php storm and do a search, just not sure what for. – tjjen Mar 13 '18 at 15:21

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.