magento / magento2

Prior to making any Submission(s), you must sign an Adobe Contributor License Agreement, available here at: https://opensource.adobe.com/cla.html. All Submissions you make to Adobe Inc. and its affiliates, assigns and subsidiaries (collectively “Adobe”) are subject to the terms of the Adobe Contributor License Agreement.
http://www.magento.com
Open Software License 3.0
11.56k stars 9.32k forks source link

skip_gallery_before/after incorrect block ordering #27216

Closed MichaelThessel closed 5 months ago

MichaelThessel commented 4 years ago

Preconditions (*)

  1. Magento 2.4 Also reproduced on 2.3.4

Steps to reproduce (*)

1.Create some product

  1. Visit product page
  2. View system.log

Expected result (*)

No messages in system.log

Actual result (*)

System log shows error:

[2020-03-09 20:06:24] main.INFO: Broken reference: the 'skip_gallery_before' tries to reorder itself towards 'product.info.media.image', but their parents are different: 'skip_gallery_before.wrapper' and 'product.info.media' respectively. [] []
[2020-03-09 20:06:24] main.INFO: Broken reference: the 'skip_gallery_after' tries to reorder itself towards 'product.info.media.image', but their parents are different: 'skip_gallery_after.wrapper' and 'product.info.media' respectively. [] []

The reason for that can be found in: (on Magento 2.3.4) vendor/magento/module-catalog/view/frontend/layout/catalog_product_view.xml

As you can see there on line 121 and 135 the before and after attributes refer to elements that are not on the same level.

This patch fixes the problem:

diff -u /tmp/catalog_product_view.xml vendor/magento/module-catalog/view/frontend/layout/catalog_product_view.xml                                                                                                                                                                                        
--- /tmp/catalog_product_view.xml       2020-03-09 13:13:42.931370664 -0700
+++ vendor/magento/module-catalog/view/frontend/layout/catalog_product_view.xml 2020-03-09 13:14:39.252674374 -0700
@@ -117,8 +117,8 @@
                         <argument name="target_id" xsi:type="string">gallery-prev-area</argument>
                     </arguments>
                 </block>
-                <container name="skip_gallery_before.wrapper" htmlTag="div" htmlClass="action-skip-wrapper">
-                    <block class="Magento\Framework\View\Element\Template" before="product.info.media.image" name="skip_gallery_before" template="Magento_Theme::html/skip.phtml">
+                <container name="skip_gallery_before.wrapper" htmlTag="div" htmlClass="action-skip-wrapper" before="product.info.media.image">
+                    <block class="Magento\Framework\View\Element\Template" name="skip_gallery_before" template="Magento_Theme::html/skip.phtml">
                         <arguments>
                             <argument name="target" xsi:type="string">gallery-next-area</argument>
                             <argument name="label" translate="true" xsi:type="string">Skip to the end of the images gallery</argument>
@@ -131,8 +131,8 @@
                         <argument name="imageHelper" xsi:type="object">Magento\Catalog\Helper\Image</argument>
                     </arguments>
                 </block>
-                <container name="skip_gallery_after.wrapper" htmlTag="div" htmlClass="action-skip-wrapper">
-                    <block class="Magento\Framework\View\Element\Template" after="product.info.media.image" name="skip_gallery_after" template="Magento_Theme::html/skip.phtml">
+                <container name="skip_gallery_after.wrapper" htmlTag="div" htmlClass="action-skip-wrapper" after="product.info.media.image">
+                    <block class="Magento\Framework\View\Element\Template" name="skip_gallery_after" template="Magento_Theme::html/skip.phtml">
                         <arguments>
                             <argument name="target" xsi:type="string">gallery-prev-area</argument>
                             <argument name="label" translate="true" xsi:type="string">Skip to the beginning of the images gallery</argument>

I would have submitted a pull request but there is no repo for the core modules?

m2-assistant[bot] commented 4 years ago

Hi @MichaelThessel. Thank you for your report. To help us process this issue please make sure that you provided the following information:

Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:

@magento give me 2.4-develop instance - upcoming 2.4.x release

For more details, please, review the Magento Contributor Assistant documentation.

@MichaelThessel do you confirm that you were able to reproduce the issue on vanilla Magento instance following steps to reproduce?


MichaelThessel commented 4 years ago

@magento give me 2.4-develop instance

magento-engcom-team commented 4 years ago

Hi @MichaelThessel. Thank you for your request. I'm working on Magento 2.4-develop instance for you

magento-engcom-team commented 4 years ago

Hi @MichaelThessel, here is your Magento instance. Admin access: https://i-27216-2-4-develop.instances.magento-community.engineering/admin_147b Login: 60ac4fb7 Password: 5b54aabba334 Instance will be terminated in up to 3 hours.

MichaelThessel commented 4 years ago

No ssh for dev instance, cannot check the logs without SSH.

m2-assistant[bot] commented 4 years ago

Hi @engcom-Lima. Thank you for working on this issue. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:

magento-engcom-team commented 4 years ago

:white_check_mark: Confirmed by @engcom-Lima Thank you for verifying the issue. Based on the provided information internal tickets MC-35995 were created

Issue Available: @engcom-Lima, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 14 days if no further activity occurs. Is this issue still relevant? If so, what is blocking it? Is there anything you can do to help move it forward? Thank you for your contributions!

magento-engcom-team commented 3 years ago

Unfortunately, we are archiving this ticket now as it did not get much attention from both Magento Community and Core developers for an extended period. This is done in an effort to create a quality, community-driven backlog which will allow us to allocate the required attention more easily.

Please feel free to comment or reopen according to the Issue reporting guidelines the ticket if you are still facing this issue on the latest 2.x-develop branch. Thank you for collaboration.

magento-engcom-team commented 3 years ago

:white_check_mark: Confirmed by @ihor-sviziev Thank you for verifying the issue. Based on the provided information internal tickets MC-35995 were created

Issue Available: @ihor-sviziev, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.

m2-assistant[bot] commented 5 months ago

Hi @engcom-Delta. Thank you for working on this issue. Looks like this issue is already verified and confirmed. But if you want to validate it one more time, please, go though the following instruction:


engcom-Delta commented 5 months ago

Hi @magentopits ,

Thanks for your reporting and collaboration.

We have verified the issue on 2.4-develop instance and the issue is no more reproducible.Kindly refer the attached screenshots.

Steps to reproduce (*)

  1. Create some product
  2. Visit product page
  3. View system.log
Screenshot 2024-06-10 at 10 48 40 AM Screenshot 2024-06-10 at 10 48 06 AM Screenshot 2024-06-10 at 11 03 04 AM

Hence closing the issue.