How to fix «Element 'item': This element is not expected» after upgrading Magento to 2.2?

xml
bug-fix
upgrade
xml-validation
magento22

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


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

#0 vendor\magento\framework\Config\Dom.php(115): Magento\Framework\Config\Dom->_initDom('<layout xmlns:x...')
#1 vendor\magento\framework\ObjectManager\Factory\AbstractFactory.php(111): Magento\Framework\Config\Dom->__construct('<layout xmlns:x...', Object(Magento\Framework\App\Arguments\ValidationState), Array, NULL, 'C:/work/clients...', '%message%\nLine:...')
#2 vendor\magento\framework\ObjectManager\Factory\Dynamic\Developer.php(66): Magento\Framework\ObjectManager\Factory\AbstractFactory->createObject('Magento\\Framewo...', Array)
#3 vendor\magento\framework\ObjectManager\ObjectManager.php(56): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('Magento\\Framewo...', Array)
#4 vendor\magento\framework\Config\DomFactory.php(42): Magento\Framework\ObjectManager\ObjectManager->create('Magento\\Framewo...', Array)
#5 vendor\magento\framework\View\Model\Layout\Update\Validator.php(141): Magento\Framework\Config\DomFactory->createDom(Array)
#6 vendor\magento\framework\View\Model\Layout\Merge.php(461): Magento\Framework\View\Model\Layout\Update\Validator->isValid('<layout xmlns:x...', 'layout_merged', false)
#7 vendor\magento\framework\View\Model\Layout\Merge.php(442): Magento\Framework\View\Model\Layout\Merge->_validateMergedLayout('LAYOUT_frontend...', '<body>\n   <refe...')
#8 generated\code\Magento\Framework\View\Model\Layout\Merge\Interceptor.php(193): Magento\Framework\View\Model\Layout\Merge->load(Array)
#9 vendor\magento\framework\View\Layout\Builder.php(86): Magento\Framework\View\Model\Layout\Merge\Interceptor->load()
#10 vendor\magento\framework\View\Layout\Builder.php(63): Magento\Framework\View\Layout\Builder->loadLayoutUpdates()
#11 vendor\magento\framework\View\Page\Config.php(197): Magento\Framework\View\Layout\Builder->build()
#12 vendor\magento\framework\View\Page\Config.php(217): Magento\Framework\View\Page\Config->build()
#13 vendor\magento\module-checkout\Controller\Index\Index.php(39): Magento\Framework\View\Page\Config->getTitle()
#14 vendor\magento\framework\Interception\Interceptor.php(58): Magento\Checkout\Controller\Index\Index->execute()

How did I upgrade earosacoustic.com from Magento 2.0.2 to 2.2.2?
(Dmitry Fedyuk) #2

I had the following invalid code block in a custom design theme:

<referenceBlock name="header-wrapper">
	<item name="authentication" xsi:type="array">
		<item name="sortOrder" xsi:type="string">1</item>
		<item name="component" xsi:type="string">Magento_Checkout/js/view/authentication</item>
		<item name="displayArea" xsi:type="string">authentication</item>
		<item name="children" xsi:type="array">
			<item name="errors" xsi:type="array">
				<item name="sortOrder" xsi:type="string">0</item>
				<item name="component" xsi:type="string">Magento_Checkout/js/view/authentication-messages</item>
				<item name="displayArea" xsi:type="string">messages</item>
			</item>
		</item>
	</item>
</referenceBlock>

I have just deleted it.