Skip to content

Product layout based on attribute_set (PR #36244) #39718

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

Open
wants to merge 22 commits into
base: 2.4-develop
Choose a base branch
from

Conversation

in-session
Copy link
Contributor

@in-session in-session commented Mar 7, 2025

Copy link

m2-assistant bot commented Mar 7, 2025

Hi @in-session. Thank you for your contribution!
Here are some useful tips on how you can test your changes using Magento test environment.
❗ Automated tests can be triggered manually with an appropriate comment:

  • @magento run all tests - run or re-run all required tests against the PR changes
  • @magento run <test-build(s)> - run or re-run specific test build(s)
    For example: @magento run Unit Tests

<test-build(s)> is a comma-separated list of build names.

Allowed build names are:
  1. Database Compare
  2. Functional Tests CE
  3. Functional Tests EE
  4. Functional Tests B2B
  5. Integration Tests
  6. Magento Health Index
  7. Sample Data Tests CE
  8. Sample Data Tests EE
  9. Sample Data Tests B2B
  10. Static Tests
  11. Unit Tests
  12. WebAPI Tests
  13. Semantic Version Checker

You can find more information about the builds here
ℹ️ Run only required test builds during development. Run all test builds before sending your pull request for review.


For more details, review the Code Contributions documentation.
Join Magento Community Engineering Slack and ask your questions in #github channel.

@in-session
Copy link
Contributor Author

@magento run all tests

@in-session
Copy link
Contributor Author

in-session commented Mar 7, 2025

Static test will be fixed after test run:

<!--
/**
 * Copyright 2014 Adobe
 * All Rights Reserved.
 */
-->

PHP Code Sniffer detected 1 violation(s): FILE: /var/www/html/app/code/Magento/Catalog/etc/adminhtml/system.xml -------------------------------------------------------------------------- FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE -------------------------------------------------------------------------- | WARNING | Copyright is missing or Copyright content/year is not valid -------------------------------------------------------------------------- FILE: /var/www/html/app/code/Magento/Catalog/etc/config.xml -------------------------------------------------------------------------- FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE -------------------------------------------------------------------------- | WARNING | Copyright is missing or Copyright content/year is not valid -------------------------------------------------------------------------- Failed asserting that 1 matches expected 0.

1
PHP Code Sniffer detected 2 violation(s): FILE: /var/www/html/app/code/Magento/Catalog/Helper/Product/View.php -------------------------------------------------------------------------- FOUND 0 ERRORS AND 4 WARNINGS AFFECTING 4 LINES -------------------------------------------------------------------------- 179 | WARNING | [x] Whitespace found at end of line 184 | WARNING | [x] Whitespace found at end of line 193 | WARNING | [ ] Line exceeds 120 characters; contains 122 characters 213 | WARNING | [ ] Line exceeds 120 characters; contains 122 characters -------------------------------------------------------------------------- PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY -------------------------------------------------------------------------- Failed asserting that 2 matches expected 0.

Semantic Version Checker because of XML changes:

System changes (MINOR) | FailureDetailsLevelTarget/LocationCode/ReasonMINORdev/layout_settings/enable_id_handle/app/code/Magento/Catalog/etc/adminhtml/system.xml:0M302 A field-node was addedMINORdev/layout_settings/enable_attribute_set_handle/app/code/Magento/Catalog/etc/adminhtml/system.xml:0M302 A field-node was added | Level | Target/Location | Code/Reason | MINOR | dev/layout_settings/enable_id_handle/app/code/Magento/Catalog/etc/adminhtml/system.xml:0 | M302 A field-node was added | MINOR | dev/layout_settings/enable_attribute_set_handle/app/code/Magento/Catalog/etc/adminhtml/system.xml:0 | M302 A field-node was added -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | --

MINOR | dev/layout_settings/enable_id_handle/app/code/Magento/Catalog/etc/adminhtml/system.xml:0 | M302 A field-node was added
MINOR | dev/layout_settings/enable_attribute_set_handle/app/code/Magento/Catalog/etc/adminhtml/system.xml:0 | M302 A field-node was added

@in-session
Copy link
Contributor Author

@magento run all tests

@in-session
Copy link
Contributor Author

@magento run all tests

@in-session
Copy link
Contributor Author

@magento run Functional Tests B2B, Functional Tests CE, Functional Tests EE

@in-session in-session marked this pull request as ready for review March 9, 2025 16:06
@engcom-Charlie engcom-Charlie added feature request Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Triage: Need PO Confirmation Requirements should be clarified/approved/confirmed with Product Manager. Not ready for fix/delivery labels Mar 10, 2025
@github-project-automation github-project-automation bot moved this to Pending Review in Pull Requests Dashboard Mar 10, 2025
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
* Copyright 2025 Adobe
* All Rights Reserved.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These copyrights are incorrect and were reverted previously. They are gone in 2.4.8-beta and 2.4.8-develop, but still present in 2.4.7-develop (on which this PR is branched).
Maybe @sidolov you can double check whether this propietary copyright notice does not end up in an actual release?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it would be nice if there was a clear statement about which copyright to use. My last status was the changes in the PR.
2.4.8-beta2: https://github.com/magento/magento2/blob/2.4.8-beta2/app/code/Magento/Catalog/etc/di.xml#L2

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct format should be:

/**
 * Copyright [first year code created] Adobe
 * All rights reserved.
 */

Source: https://developer.adobe.com/commerce/contributor/guides/code-contributions/backward-compatibility-policy/#adding-a-constructor-parameter

So the year 2025 should be replaced with 2013 over here.

Same remark around the other files changed in this PR, please don't use the year 2025 unless it's a new file.

@wigman: is this what you were after? Or did I misunderstood?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hostep no, that was not wat I was after :) the copyright notice is not supposed to change to "all rights reserved", unless the decision to roll that change back has been reversed, and I need to check with Adobe core team if that can be prevented.

Copy link
Contributor

@hostep hostep Mar 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So it changes from * Copyright © Magento, Inc. All rights reserved. to Copyright 2013 Adobe * All Rights Reserved.

All rights reserved has always been there as far as I know (example from 10 years ago). It's just that it was previously 'Magento', then 'Magento, Inc', which may no longer exist, and is now 'Adobe'.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, you are completely right. I misread. It thought it was a partial return of these changes, which were quite severe 😅 24ce222 thanks!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No worries. You may be interested in magento/magento-coding-standard#492 then.

@in-session
Copy link
Contributor Author

@magento run all tests

@in-session
Copy link
Contributor Author

@engcom-Charlie PR is ready for review.

  • Functional tests are not related to the PR
  • Semantic Version Checker due to core XML changes.

@engcom-Charlie engcom-Charlie self-assigned this Mar 13, 2025
@Priyakshic Priyakshic added the Project: Community Picked PRs upvoted by the community label Mar 13, 2025
@Priyakshic Priyakshic moved this to Pending Review in Community Dashboard Mar 13, 2025
@engcom-Hotel engcom-Hotel requested a review from hostep March 20, 2025 11:14
@engcom-Hotel
Copy link
Contributor

Hello @in-session,

Thank you for your contribution!

As this PR is marked as a feature request, we require PO approval to proceed. We have initiated an internal discussion regarding this PR and will be placing it on hold for the time being.

@engcom-Hotel engcom-Hotel moved this from Pending Review to On Hold in Community Dashboard Mar 20, 2025
@hostep hostep mentioned this pull request Mar 21, 2025
5 tasks
@in-session
Copy link
Contributor Author

@magento run all tests

@engcom-Hotel
Copy link
Contributor

@magento run all tests

@engcom-Hotel engcom-Hotel self-requested a review April 22, 2025 05:33
@ct-prd-projects-boards-automation ct-prd-projects-boards-automation bot moved this from On Hold to Review in Progress in Community Dashboard Apr 22, 2025
@engcom-Hotel engcom-Hotel removed Progress: on hold Triage: Need PO Confirmation Requirements should be clarified/approved/confirmed with Product Manager. Not ready for fix/delivery labels Apr 22, 2025
@engcom-Hotel
Copy link
Contributor

Hello @in-session,

We have received approval on this PR from the PO. Therefore, we will proceed with further activities related to it.

Thanks

@engcom-Bravo engcom-Bravo added the Triage: Dev.Experience Issue related to Developer Experience and needs help with Triage to Confirm or Reject it label Apr 22, 2025
Copy link
Contributor

@engcom-Hotel engcom-Hotel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @in-session,

Thank you for the contribution!

To ensure the new configuration options (enable_id_handle and enable_attribute_set_handle) work as intended and to prevent regressions, I suggest adding functional tests for the following scenarios:

  1. When each flag is enabled and disabled.
  2. Verifying that the correct layout handles are added or skipped based on the configuration.

These tests will enhance reliability, ensure expected behaviour across use cases, and align with Magento's high-quality standards. Let me know your thoughts on this.

Thanks

@engcom-Hotel engcom-Hotel moved this from Review in Progress to Changes Requested in Community Dashboard Apr 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Progress: needs update Project: Community Picked PRs upvoted by the community Triage: Dev.Experience Issue related to Developer Experience and needs help with Triage to Confirm or Reject it
Projects
Status: Changes Requested
Development

Successfully merging this pull request may close these issues.

7 participants