-
Notifications
You must be signed in to change notification settings - Fork 9.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgrade from Magento CE 2.1.9 to 2.2.0 - Element 'block', attribute 'class': [facet 'pattern'] The value '\Magento\Framework\View\Element\Template' is not accepted by the pattern '[A-Z][a-zA-Z\d]*(\\[A-Z][a-zA-Z\d]*)*'. #11110
Comments
Leading backslash in class name is not allowed. Please check if it works if you remove all such occurrences. |
@orlangur Where am I looking, XML, PHP or phtml files? |
OK I found it.. next one:
|
That's strange, such issue should not appear in core files. Please try remove |
@orlangur I don't think it does. I have it in my own extended widget.xsd |
Oh :) That was unexpected. Then you need to check the changes in original |
@orlangur If only I was the original developer that changed it :) |
@orlangur One more. I know this can be fixed by updating the copy direct from the module author.
|
This is a known one :) As a workaround you can downgrade |
Yes thank you 👍 |
@craigcarnell how did you fix this one? Many thanks! 1 exception(s): Element 'move', attribute 'after': '' is not a valid value of the atomic type 'elementPositionType'. Element 'move', attribute 'after': [facet 'pattern'] The value '' is not accepted by the pattern '[a-zA-Z][a-zA-Z\d-_.]*|-'. Element 'move', attribute 'after': '' is not a valid value of the atomic type 'elementPositionType'. Element 'referenceContainer', attribute 'before': The attribute 'before' is not allowed. Exception #0 (Magento\Framework\Config\Dom\ValidationException): Element 'move', attribute 'after': [facet 'pattern'] The value '' is not accepted by the pattern '[a-zA-Z][a-zA-Z\d-_.]*|-'. Element 'move', attribute 'after': '' is not a valid value of the atomic type 'elementPositionType'. Element 'move', attribute 'after': [facet 'pattern'] The value '' is not accepted by the pattern '[a-zA-Z][a-zA-Z\d-_.]*|-'. Element 'move', attribute 'after': '' is not a valid value of the atomic type 'elementPositionType'. Element 'referenceContainer', attribute 'before': The attribute 'before' is not allowed. |
Exception #0 (Magento\Framework\Config\Dom\ValidationException): Element 'block', attribute 'class': [facet 'pattern'] The value '\Magento\Framework\View\Element\Template' is not accepted by the pattern '[A-Z]a-zA-Z\d*'. \Magento\Framework\View\Element\Template -> Magento\Framework\View\Element\Template In layout, the attribute class should be specified without \ <block class="\Magento\Sales\Block\Order\Info" -> <block class="Magento\Sales\Block\Order\Info" |
@andidhouse all errors you mentioned looks pretty straightforward to me, please point out which of them seems vague to you. Basically it seems like XSD schemas were not changed but somehow validation didn't work properly before.
For example, this means that |
I have a similar issue but strange as it sounds, I can't understand which file is problematic, this is my exception:
|
Hello I'm having similar errors, does anyone solve this?... because I see It was a solution but I cannot understand how @craigcarnell solve it, if you guys can please help a little bit explaining how to solve will appreciate. Thanks
|
@lecahipe in your case simply remove leading backslashes: |
@orlangur thanks for your help, I was lost... and the solution was such a simple thing now everything is working. Thanks 👍 |
I have same issue . One of xml file, has the syntax like does not support at magento 2.2, I have changes it to Also at on some layout xml files i have found some wrong syntax Like
remoe after as it is nested after error |
Exactly, what file should we edit ? |
I resolve similar issue But I think that the regular expression did not resolve their purpose. |
We are having similar issues; oddly though only after moving server. On the old server the same issue is not present: 1 exception(s): Element 'argument': Not all fields of key identity-constraint 'blockActionArgumentName' evaluate to a node. Exception #0 (Magento\Framework\Config\Dom\ValidationException): Element 'argument': The attribute 'name' is required but missing. Element 'argument': Not all fields of key identity-constraint 'blockActionArgumentName' evaluate to a node. #0 /var/www/vhosts/opumo.com/htdocs/vendor/magento/framework/Config/Dom.php(115): Magento\Framework\Config\Dom->_initDom('<layout xmlns:x...') |
@lecahipe Which file have you changed, and where was it, please? |
I'm trying to install a template in a local server using Magento. I made a copy to the server and then an upgrade to Magento. My Admin Panel is functioning but I face a problem when I access localhost. I'm working in developer mode. Here's my output of the page.
I have no idea to solve this. Can someone please help me on this? |
Same issue: Element 'script', attribute 'data-requiremodule': The attribute 'data-requiremodule' is not allowed. Element 'script', attribute 'data-requiremodule': The attribute 'data-requiremodule' is not allowed. Element 'script', attribute 'data-requiremodule': The attribute 'data-requiremodule' is not allowed. Element 'script', attribute 'data-requiremodule': The attribute 'data-requiremodule' is not allowed. Element 'remove': This element is not expected. Expected is one of ( block, container, referenceBlock, referenceContainer, uiComponent ). #0 /var/www/vhosts/arredabene.local/httpdocs/vendor/magento/framework/Config/Dom.php(115): Magento\Framework\Config\Dom->_initDom('<layout xmlns:x...') Have you find any solution ? |
@D-David11 I had install Magento 2.2.3 in my server and then applied the template and problems started to appear. After many tests i found out that the main cause was incompatibility between Magento and the installed template. Check the details of your template and if necessary install a previous version of Magento. Regards |
@nunorcsousa @D-David11 simply eliminate all XSD schema violations. Looks like in 2.1 validation did not work properly thus you could have invalid declarations without even knowing it. |
1 exception(s): Exception #0 (Magento\Framework\Config\Dom\ValidationException): Element 'move': This element is not expected. #0 /home/182587.cloudwaysapps.com/ghzznzswbg/public_html/vendor/magento/framework/Config/Dom.php(115): Magento\Framework\Config\Dom->_initDom('<layout xmlns:x...') Best Regards |
@salelsol you need to find and fix improper GitHub is intended for bug reports, please use Magento Stack Exchange for questions. Also, googling observed error is usually helpful. |
Preconditions
Steps to reproduce
Expected result
Actual result
1 exception(s):
Exception #0 (Magento\Framework\Config\Dom\ValidationException): Element 'block', attribute 'class': [facet 'pattern'] The value '\Magento\Framework\View\Element\Template' is not accepted by the pattern '[A-Z][a-zA-Z\d](\[A-Z][a-zA-Z\d])*'.
Line: 703
Element 'block', attribute 'class': '\Magento\Framework\View\Element\Template' is not a valid value of the atomic type 'blockClassType'.
Line: 703
Exception #0 (Magento\Framework\Config\Dom\ValidationException): Element 'block', attribute 'class': [facet 'pattern'] The value '\Magento\Framework\View\Element\Template' is not accepted by the pattern '[A-Z][a-zA-Z\d](\[A-Z][a-zA-Z\d])*'.
Line: 703
Element 'block', attribute 'class': '\Magento\Framework\View\Element\Template' is not a valid value of the atomic type 'blockClassType'.
Line: 703
#0 /Users/ccarnell/Sites/harttools-anz/vendor/magento/framework/Config/Dom.php(115): Magento\Framework\Config\Dom->_initDom('<layout xmlns:x...')
#1 /Users/ccarnell/Sites/harttools-anz/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(111): Magento\Framework\Config\Dom->__construct('<layout xmlns:x...', Object(Magento\Framework\App\Arguments\ValidationState), Array, NULL, '/Users/ccarnell...', '%message%\nLine:...')
#2 /Users/ccarnell/Sites/harttools-anz/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(66): Magento\Framework\ObjectManager\Factory\AbstractFactory->createObject('Magento\Framewo...', Array)
#3 /Users/ccarnell/Sites/harttools-anz/vendor/magento/framework/ObjectManager/ObjectManager.php(56): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('Magento\Framewo...', Array)
#4 /Users/ccarnell/Sites/harttools-anz/vendor/magento/framework/Config/DomFactory.php(42): Magento\Framework\ObjectManager\ObjectManager->create('Magento\Framewo...', Array)
#5 /Users/ccarnell/Sites/harttools-anz/vendor/magento/framework/View/Model/Layout/Update/Validator.php(125): Magento\Framework\Config\DomFactory->createDom(Array)
#6 /Users/ccarnell/Sites/harttools-anz/vendor/magento/framework/View/Model/Layout/Merge.php(461): Magento\Framework\View\Model\Layout\Update\Validator->isValid('<layout xmlns:x...', 'layout_merged', false)
#7 /Users/ccarnell/Sites/harttools-anz/vendor/magento/framework/View/Model/Layout/Merge.php(442): Magento\Framework\View\Model\Layout\Merge->_validateMergedLayout('LAYOUT_frontend...', '<!--\n <refer...')
#8 /Users/ccarnell/Sites/harttools-anz/generated/code/Magento/Framework/View/Model/Layout/Merge/Interceptor.php(193): Magento\Framework\View\Model\Layout\Merge->load(Array)
#9 /Users/ccarnell/Sites/harttools-anz/vendor/magento/framework/View/Layout/Builder.php(86): Magento\Framework\View\Model\Layout\Merge\Interceptor->load()
#10 /Users/ccarnell/Sites/harttools-anz/vendor/magento/framework/View/Layout/Builder.php(63): Magento\Framework\View\Layout\Builder->loadLayoutUpdates()
#11 /Users/ccarnell/Sites/harttools-anz/vendor/magento/framework/View/Layout.php(254): Magento\Framework\View\Layout\Builder->build()
#12 /Users/ccarnell/Sites/harttools-anz/vendor/magento/framework/View/Layout.php(875): Magento\Framework\View\Layout->build()
#13 /Users/ccarnell/Sites/harttools-anz/generated/code/Magento/Framework/View/Layout/Interceptor.php(414): Magento\Framework\View\Layout->getBlock('page_content_he...')
#14 /Users/ccarnell/Sites/harttools-anz/vendor/magento/module-cms/Helper/Page.php(171): Magento\Framework\View\Layout\Interceptor->getBlock('page_content_he...')
#15 /Users/ccarnell/Sites/harttools-anz/vendor/magento/module-cms/Controller/Index/Index.php(43): Magento\Cms\Helper\Page->prepareResultPage(Object(Magento\Cms\Controller\Index\Index\Interceptor), 'home')
#16 /Users/ccarnell/Sites/harttools-anz/generated/code/Magento/Cms/Controller/Index/Index/Interceptor.php(24): Magento\Cms\Controller\Index\Index->execute(NULL)
#17 /Users/ccarnell/Sites/harttools-anz/vendor/magento/framework/App/Action/Action.php(107): Magento\Cms\Controller\Index\Index\Interceptor->execute()
#18 /Users/ccarnell/Sites/harttools-anz/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Framework\App\Action\Action->dispatch(Object(Magento\Framework\App\Request\Http))
#19 /Users/ccarnell/Sites/harttools-anz/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Cms\Controller\Index\Index\Interceptor->___callParent('dispatch', Array)
#20 /Users/ccarnell/Sites/harttools-anz/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Cms\Controller\Index\Index\Interceptor->Magento\Framework\Interception{closure}(Object(Magento\Framework\App\Request\Http))
#21 /Users/ccarnell/Sites/harttools-anz/generated/code/Magento/Cms/Controller/Index/Index/Interceptor.php(39): Magento\Cms\Controller\Index\Index\Interceptor->___callPlugins('dispatch', Array, Array)
#22 /Users/ccarnell/Sites/harttools-anz/vendor/magento/framework/App/FrontController.php(55): Magento\Cms\Controller\Index\Index\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))
#23 /Users/ccarnell/Sites/harttools-anz/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Framework\App\FrontController->dispatch(Object(Magento\Framework\App\Request\Http))
#24 /Users/ccarnell/Sites/harttools-anz/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Framework\App\FrontController\Interceptor->___callParent('dispatch', Array)
#25 /Users/ccarnell/Sites/harttools-anz/vendor/magento/module-store/App/FrontController/Plugin/RequestPreprocessor.php(94): Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception{closure}(Object(Magento\Framework\App\Request\Http))
#26 /Users/ccarnell/Sites/harttools-anz/vendor/magento/framework/Interception/Interceptor.php(135): Magento\Store\App\FrontController\Plugin\RequestPreprocessor->aroundDispatch(Object(Magento\Framework\App\FrontController\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))
#27 /Users/ccarnell/Sites/harttools-anz/vendor/magento/module-page-cache/Model/App/FrontController/BuiltinPlugin.php(69): Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception{closure}(Object(Magento\Framework\App\Request\Http))
#28 /Users/ccarnell/Sites/harttools-anz/vendor/magento/framework/Interception/Interceptor.php(135): Magento\PageCache\Model\App\FrontController\BuiltinPlugin->aroundDispatch(Object(Magento\Framework\App\FrontController\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))
#29 /Users/ccarnell/Sites/harttools-anz/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception{closure}(Object(Magento\Framework\App\Request\Http))
#30 /Users/ccarnell/Sites/harttools-anz/generated/code/Magento/Framework/App/FrontController/Interceptor.php(26): Magento\Framework\App\FrontController\Interceptor->___callPlugins('dispatch', Array, NULL)
#31 /Users/ccarnell/Sites/harttools-anz/vendor/magento/framework/App/Http.php(135): Magento\Framework\App\FrontController\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))
#32 /Users/ccarnell/Sites/harttools-anz/vendor/magento/framework/App/Bootstrap.php(256): Magento\Framework\App\Http->launch()
#33 /Users/ccarnell/Sites/harttools-anz/pub/index.php(37): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http))
#34 {main}
The text was updated successfully, but these errors were encountered: