Skip to content
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

Theme: Added html node to page xml root, cause validation error #11697

Closed
Triloworld opened this issue Oct 24, 2017 · 6 comments
Closed

Theme: Added html node to page xml root, cause validation error #11697

Triloworld opened this issue Oct 24, 2017 · 6 comments
Labels
Fixed in 2.2.x The issue has been fixed in 2.2 release line Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development

Comments

@Triloworld
Copy link

Triloworld commented Oct 24, 2017

Preconditions

  1. Magento 2.2 (In Magento 2.0 it's working fine - tested)
  2. libxml2 Version => 2.9.1
  3. PHP 7.0.23-1~dotdeb+8.1 (cli) ( NTS )
  4. New empty working theme with name SAMPLE. (check that is working correctly because this help point to bug)
  5. Optional: Add URI to validate in IDE xml files: http://devdocs.magento.com/guides/v2.0/config-guide/cli/config-cli-subcommands-urn.html

Steps to reproduce

  1. Create file: SAMPLE/Magento_Theme/layout/default_head_blocks.xml
  2. Add this content:
<?xml version="1.0"?>
    <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
       <html>
           <attribute name="class" value="TEST" />
       </html>
   </page>
  1. Refresh homepage

Expected result

  1. Html node have new attribute class="TEST" what is described by this files:

/vendor/magento/framework/View/Layout/etc/html.xsd
/vendor/magento/framework/View/Layout/etc/page_configuration.xsd

  1. Optional: Give error in IDE when URI is correctly connected to XSD schemas
  2. Optional: Documentation non exist. There is $htmlAttributes which prevent standard overwrite. what is preferable way?

Actual result


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


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

#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, '/var/www/chroot...', '%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(125): 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...', '<!--\n    <refer...')
#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/Layout.php(254): Magento\Framework\View\Layout\Builder->build()
#12 /vendor/magento/framework/View/Layout.php(875): Magento\Framework\View\Layout->build()
#13 /generated/code/Magento/Framework/View/Layout/Interceptor.php(414): Magento\Framework\View\Layout->getBlock('page_content_he...')
#14 /vendor/magento/module-cms/Helper/Page.php(171): Magento\Framework\View\Layout\Interceptor->getBlock('page_content_he...')
#15 /vendor/magento/framework/Interception/Interceptor.php(58): Magento\Cms\Helper\Page->prepareResultPage(Object(Magento\Cms\Controller\Index\Index\Interceptor), 'home')
#16 /vendor/magento/framework/Interception/Interceptor.php(138): Magento\Cms\Helper\Page\Interceptor->___callParent('prepareResultPa...', Array)
#17 /app/code/Amasty/Shopby/Plugin/CmsPageHelperPlugin.php(79): Magento\Cms\Helper\Page\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Cms\Controller\Index\Index\Interceptor), 'home')
#18 /vendor/magento/framework/Interception/Interceptor.php(135): Amasty\Shopby\Plugin\CmsPageHelperPlugin->aroundPrepareResultPage(Object(Magento\Cms\Helper\Page\Interceptor), Object(Closure), Object(Magento\Cms\Controller\Index\Index\Interceptor), 'home')
#19 /vendor/magento/framework/Interception/Interceptor.php(153): Magento\Cms\Helper\Page\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Cms\Controller\Index\Index\Interceptor), 'home')
#20 /generated/code/Magento/Cms/Helper/Page/Interceptor.php(26): Magento\Cms\Helper\Page\Interceptor->___callPlugins('prepareResultPa...', Array, NULL)
#21 /vendor/magento/module-cms/Controller/Index/Index.php(43): Magento\Cms\Helper\Page\Interceptor->prepareResultPage(Object(Magento\Cms\Controller\Index\Index\Interceptor), 'home')
#22 /vendor/magento/framework/Interception/Interceptor.php(58): Magento\Cms\Controller\Index\Index->execute()
#23 /vendor/magento/framework/Interception/Interceptor.php(138): Magento\Cms\Controller\Index\Index\Interceptor->___callParent('execute', Array)
#24 /vendor/magento/framework/Interception/Interceptor.php(153): Magento\Cms\Controller\Index\Index\Interceptor->Magento\Framework\Interception\{closure}()
#25 /generated/code/Magento/Cms/Controller/Index/Index/Interceptor.php(26): Magento\Cms\Controller\Index\Index\Interceptor->___callPlugins('execute', Array, Array)
#26 /vendor/magento/framework/App/Action/Action.php(107): Magento\Cms\Controller\Index\Index\Interceptor->execute()
#27 /vendor/magento/framework/Interception/Interceptor.php(58): Magento\Framework\App\Action\Action->dispatch(Object(Magento\Framework\App\Request\Http))
#28 /vendor/magento/framework/Interception/Interceptor.php(138): Magento\Cms\Controller\Index\Index\Interceptor->___callParent('dispatch', Array)
#29 /vendor/magento/framework/Interception/Interceptor.php(153): Magento\Cms\Controller\Index\Index\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Request\Http))
#30 /generated/code/Magento/Cms/Controller/Index/Index/Interceptor.php(39): Magento\Cms\Controller\Index\Index\Interceptor->___callPlugins('dispatch', Array, Array)
#31 /vendor/magento/framework/App/FrontController.php(55): Magento\Cms\Controller\Index\Index\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))
#32 /vendor/magento/framework/Interception/Interceptor.php(58): Magento\Framework\App\FrontController->dispatch(Object(Magento\Framework\App\Request\Http))
#33 /vendor/magento/framework/Interception/Interceptor.php(138): Magento\Framework\App\FrontController\Interceptor->___callParent('dispatch', Array)
#34 /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))
#35 /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))
#36 /app/code/Mirasvit/SearchAutocomplete/Plugin/ResponsePlugin.php(156): Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Request\Http))
#37 /vendor/magento/framework/Interception/Interceptor.php(135): Mirasvit\SearchAutocomplete\Plugin\ResponsePlugin->aroundDispatch(Object(Magento\Framework\App\FrontController\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))
#38 /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))
#39 /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))
#40 /vendor/magento/framework/Interception/Interceptor.php(153): Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Request\Http))
#41 /generated/code/Magento/Framework/App/FrontController/Interceptor.php(26): Magento\Framework\App\FrontController\Interceptor->___callPlugins('dispatch', Array, Array)
#42 /vendor/magento/framework/App/Http.php(135): Magento\Framework\App\FrontController\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))
#43 /vendor/magento/framework/App/Bootstrap.php(256): Magento\Framework\App\Http->launch()
#44 /index.php(39): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http))
@adrian-martinez-interactiv4
Copy link
Contributor

@Triloworld PRs on the way

@Triloworld
Copy link
Author

Triloworld commented Oct 30, 2017

Sorry for wrong attribute. What I mean is 'class="test"' but this problem was more abstract (any attribute won't work). Thanks for PRs.

PS: Tested your solution and work fine for me

okorshenko pushed a commit that referenced this issue Nov 4, 2017
…validation error #11858

 - Merge Pull Request #11858 from adrian-martinez-interactiv4/magento2:FR22#THEME-HTML-NODE-PAGE-XML-ROOT
 - Merged commits:
   1. ec8f96f
okorshenko pushed a commit that referenced this issue Nov 4, 2017
@magento-team
Copy link
Contributor

Internal ticket to track issue progress: MAGETWO-82999

@magento-team magento-team added 2.2.x Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development labels Nov 4, 2017
@okorshenko
Copy link
Contributor

The issue has been fixed in 2.2-develop branch and will be available with 2.2.2 release

@okorshenko okorshenko added the Fixed in 2.2.x The issue has been fixed in 2.2 release line label Nov 4, 2017
okorshenko pushed a commit that referenced this issue Nov 4, 2017
…o page xml root, cause validation error #11862

 - Merge Pull Request #11862 from adrian-martinez-interactiv4/magento2:FR23#THEME-HTML-NODE-PAGE-XML-ROOT
 - Merged commits:
   1. cfeda21
okorshenko pushed a commit that referenced this issue Nov 4, 2017
@magento-team
Copy link
Contributor

Internal ticket to track issue progress: MAGETWO-83002

okorshenko pushed a commit that referenced this issue Nov 7, 2017
…o page xml root, cause validation error #11861

 - Merge Pull Request #11861 from adrian-martinez-interactiv4/magento2:FR21#THEME-HTML-NODE-PAGE-XML-ROOT
 - Merged commits:
   1. 2370f14
okorshenko pushed a commit that referenced this issue Nov 7, 2017
@Sharlyll
Copy link

am having same issues as Trlioworld.

magento 2.2.2
PHP 7

1 exception(s):
Exception #0 (Magento\Framework\Config\Dom\ValidationException): Element 'title', attribute 'name': The attribute 'name' is not allowed.
Line: 1001

Exception #0 (Magento\Framework\Config\Dom\ValidationException): Element 'title', attribute 'name': The attribute 'name' is not allowed.
Line: 1001

#0 /home/user/public_html/vendor/magento/framework/Config/Dom.php(115): Magento\Framework\Config\Dom->_initDom('<layout xmlns:x...')
#1 /home/user/public_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, '/home/user/...', '%message%\nLine:...')
#2 /home/user/public_html/vendor/magento/framework/ObjectManager/Factory/Compiled.php(108): Magento\Framework\ObjectManager\Factory\AbstractFactory->createObject('Magento\Framewo...', Array)
#3 /home/user/public_html/vendor/magento/framework/ObjectManager/ObjectManager.php(56): Magento\Framework\ObjectManager\Factory\Compiled->create('Magento\Framewo...', Array)
#4 /home/user/public_html/vendor/magento/framework/Config/DomFactory.php(42): Magento\Framework\ObjectManager\ObjectManager->create('Magento\Framewo...', Array)
#5 /home/user/public_html/vendor/magento/framework/View/Model/Layout/Update/Validator.php(141): Magento\Framework\Config\DomFactory->createDom(Array)
#6 /home/user/public_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 /home/user/public_html/vendor/magento/framework/View/Model/Layout/Merge.php(442): Magento\Framework\View\Model\Layout\Merge->_validateMergedLayout('LAYOUT_frontend...', '\n <refe...')
#8 /home/user/public_html/vendor/magento/framework/View/Layout/Builder.php(86): Magento\Framework\View\Model\Layout\Merge->load()
#9 /home/user/public_html/vendor/magento/framework/View/Layout/Builder.php(63): Magento\Framework\View\Layout\Builder->loadLayoutUpdates()
#10 /home/user/public_html/vendor/magento/framework/View/Layout.php(254): Magento\Framework\View\Layout\Builder->build()
#11 /home/user/public_html/vendor/magento/framework/View/Layout.php(738): Magento\Framework\View\Layout->build()
#12 /home/user/public_html/generated/code/Magento/Framework/View/Layout/Interceptor.php(336): Magento\Framework\View\Layout->unsetElement('catalog.topnav')
#13 /home/user/public_html/app/code/Codazon/ThemeOptions/Framework/App/Action/Action/Plugin.php(72): Magento\Framework\View\Layout\Interceptor->unsetElement('catalog.topnav')
#14 /home/user/public_html/app/code/Codazon/ThemeOptions/Framework/App/Action/Action/Plugin.php(119): Codazon\ThemeOptions\Framework\App\Action\Action\Plugin->progress(Object(Magento\Framework\View\Layout\Interceptor))
#15 /home/user/public_html/vendor/magento/framework/Interception/Interceptor.php(146): Codazon\ThemeOptions\Framework\App\Action\Action\Plugin->afterDispatch(Object(Drc\Faq\Controller\Faq\Index\Interceptor), Object(Magento\Framework\View\Result\Page\Interceptor), Object(Magento\Framework\App\Request\Http))
#16 /home/user/public_html/vendor/magento/framework/Interception/Interceptor.php(153): Drc\Faq\Controller\Faq\Index\Interceptor->Magento\Framework\Interception{closure}(Object(Magento\Framework\App\Request\Http))
#17 /home/user/public_html/generated/code/Drc/Faq/Controller/Faq/Index/Interceptor.php(26): Drc\Faq\Controller\Faq\Index\Interceptor->___callPlugins('dispatch', Array, Array)
#18 /home/user/public_html/vendor/magento/framework/App/FrontController.php(55): Drc\Faq\Controller\Faq\Index\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))
#19 /home/user/public_html/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Framework\App\FrontController->dispatch(Object(Magento\Framework\App\Request\Http))
#20 /home/user/public_html/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Framework\App\FrontController\Interceptor->___callParent('dispatch', Array)
#21 /home/user/public_html/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))
#22 /home/user/public_html/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))
#23 /home/user/public_html/vendor/magento/module-page-cache/Model/App/FrontController/BuiltinPlugin.php(73): Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception{closure}(Object(Magento\Framework\App\Request\Http))
#24 /home/user/public_html/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))
#25 /home/user/public_html/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception{closure}(Object(Magento\Framework\App\Request\Http))
#26 /home/user/public_html/generated/code/Magento/Framework/App/FrontController/Interceptor.php(26): Magento\Framework\App\FrontController\Interceptor->___callPlugins('dispatch', Array, NULL)
#27 /home/user/public_html/vendor/magento/framework/App/Http.php(135): Magento\Framework\App\FrontController\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))
#28 /home/user/public_html/vendor/magento/framework/App/Bootstrap.php(256): Magento\Framework\App\Http->launch()
#29 /home/user/public_html/index.php(39): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http\Interceptor))
#30 {main}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Fixed in 2.2.x The issue has been fixed in 2.2 release line Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development
Projects
None yet
Development

No branches or pull requests

6 participants