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

Layout shouldn't be set in a page_layout xml file. #537

Open
jasperzeinstra opened this issue Jun 15, 2020 · 5 comments
Open

Layout shouldn't be set in a page_layout xml file. #537

jasperzeinstra opened this issue Jun 15, 2020 · 5 comments

Comments

@jasperzeinstra
Copy link

Preconditions (*)

  1. Magento Page Builder version >= 1.3.0

Steps to reproduce (*)

  1. Create a Magento_Catalog/layout/catalaog_category_view.xml in your theme.
  2. Set the attribute layout of the xml-node page to 1column

Expected result (*)

  1. Category page has layout one column

Actual result (*)

  1. Category page has layout two columns left

This issue is caused by the file view/frontend/page_layout/catalog_category_view.xml. A page_layout file should never set a layout becasue they are the last loaded layout xml files. This bug overwrites the value for layout set in the theme.

This is the patch that resolves the issue. I don't have a paid GitHub account, so can't create a PR.

===================================================================
--- a/view/frontend/page_layout/catalog_category_view.xml	(date 1592218590076)
+++ b/view/frontend/page_layout/catalog_category_view.xml	(date 1592218590076)
@@ -5,7 +5,7 @@
  * See COPYING.txt for license details.
  */
 -->
-<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
+<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
     <body>
         <referenceContainer name="category.view.container">
             <referenceBlock name="category.description" template="Magento_PageBuilder::catalog/category/view/description.phtml"/>
@m2-assistant
Copy link

m2-assistant bot commented Jun 15, 2020

Hi @jasperzeinstra. Thank you for your report.
To help us process this issue please make sure that you provided sufficient information.

Please, add a comment to assign the issue: @magento I am working on this


@m2-community-project m2-community-project bot added this to Ready for Grooming in Backlog Jun 15, 2020
@bluemwhitew
Copy link
Contributor

For what it's worth, layout="2columns-left" is applied to other instances of catalog_category_view.xml, too (see attached).

Screenshot 2020-08-11 at 11 17 05

@marvinhinz
Copy link

marvinhinz commented Sep 20, 2021

Very strange, after an update from magento 2.4.2-p1 to 2.4.3 suddenly this exact issue surfaced. Now im not able to change the layout on the category page anymore from the theme. When removing the layout attribute in /magento/vendor/magento/module-page-builder/view/frontend/page_layout/catalog_category_view.xml it works again.

unailopez16 added a commit to unailopez16/magento2-page-builder that referenced this issue Sep 27, 2021
@SamuelColacchia
Copy link

SamuelColacchia commented Sep 29, 2021

I think the issue is that catalog_category_view.xml is in the wrong folder.

Is there any specific reason it is in app/code/Magento/PageBuilder/view/frontend/page_layout ?

If not then it should be moved to app/code/Magento/PageBuilder/view/frontend/layout which fixes the current issue and makes sense given that app/code/Magento/PageBuilder/view/frontend/layouts.xml contains the 3 page layouts and no references to catalog_category_view

    <layout id="cms-full-width">
        <label translate="true">Page -- Full Width</label>
    </layout>
    <layout id="category-full-width">
        <label translate="true">Category -- Full Width</label>
    </layout>
    <layout id="product-full-width">
        <label translate="true">Product -- Full Width</label>
    </layout>

Looks like there is already a pull request #782 to fix this issue @unailopez16 what do you think about this propose solution?

Additionally testing this solution with luma on 2.4.3 seems to fix the issue.

@engcom-Hotel
Copy link
Collaborator

Hello @jasperzeinstra,

Thanks for the report and collaboration!

The mentioned issue is not reproducible for us. Please refer to the below comment for more details:

#782 (comment)

Let us know in case we have missed anything.

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Backlog
  
Pull Request In Progress
Development

Successfully merging a pull request may close this issue.

5 participants