Magento 2.2.0 upgrade, error attribute type is not allowed
-
14-04-2021 - |
Question
I was able to upgrade a Magento store from 2.1.6 to 2.2.0. The backend is working very good, but I am encountering an exception on the front office.
The exception message says: Element 'block', attribute 'type': The attribute 'type' is not allowed.
The whole situation is described in the next post from GitHub: https://github.com/magento/magento2/issues/11839
I'm new in Magento. Could give me a link which describes from where should I remove the invalid type attribute or other attributes or from where can I refactor it?
Solution
Those lines are most likely ones in your layout XMLs:
Element 'block', attribute 'type': The attribute 'type' is not allowed.
Line: 776
Element 'block', attribute 'type': The attribute 'type' is not allowed.
Line: 783
Element 'block', attribute 'type': The attribute 'type' is not allowed.
Line: 816
Most likely in layout XMLs you have declarations like
<block type="..."
Which does not correspond to lib/internal/Magento/Framework/View/Layout/etc/elements.xsd and need to be replaced to
<block class="..."
OTHER TIPS
After I updated it by operating the composer, it no longer works properly. The error report is as follows:
1 exception(s):
Exception #0 (Magento\Framework\Config\Dom\ValidationException): Element 'block', attribute 'display': The attribute 'display' is not allowed.
Line: 689
Exception #0 (Magento\Framework\Config\Dom\ValidationException): Element 'block', attribute 'display': The attribute 'display' is not allowed.
Line: 689
#0 /vendor/magento/framework/Config/Dom.php(115): Magento\Framework\Config\Dom->_initDom('<layout xmlns:x...')
Why is that ?