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

Move assign category ids to beforeToHtml instead inside load collection #32390

Conversation

mrtuvn
Copy link
Contributor

@mrtuvn mrtuvn commented Mar 6, 2021

Description (*)

The main purpose move assign category ids operation to _beforeToHtml. Clean up getLoadedProductCollection like before version 2.3. Make sure we get predictable raw data collection product (any plugin from core or 3rd-party supplier can use this entry point for get product collection data from block list). Then before render data html to browser we set data category_id to product if data available

Here is commit previous change
03a6f4d
baebe46

Related Pull Requests

Fixed Issues (if relevant)

  1. Fixes Breaking BC changes in the product list block #32268

Manual testing scenarios (*)

  1. Visit any category page have product lists
  2. Go to details view one specific product (Should work without any problem)

Questions or comments

CC: @tzyganu

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds are green)

@m2-assistant
Copy link

m2-assistant bot commented Mar 6, 2021

Hi @mrtuvn. Thank you for your contribution
Here are some useful tips how you can test your changes using Magento test environment.
Add the comment under your pull request to deploy test or vanilla Magento instance:

  • @magento give me test instance - deploy test instance based on PR changes
  • @magento give me 2.4-develop instance - deploy vanilla Magento instance

❗ 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

ℹ️ Please run only needed test builds instead of all when developing. Please run all test builds before sending your PR for review.

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

⚠️ According to the Magento Contribution requirements, all Pull Requests must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.

🕙 You can find the schedule on the Magento Community Calendar page.

📞 The triage of Pull Requests happens in the queue order. If you want to speed up the delivery of your contribution, please join the Community Contributions Triage session to discuss the appropriate ticket.

🎥 You can find the recording of the previous Community Contributions Triage on the Magento Youtube Channel

✏️ Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel

@mrtuvn
Copy link
Contributor Author

mrtuvn commented Mar 6, 2021

@magento run all tests

@ihor-sviziev ihor-sviziev added Auto-Tests: Not Covered Changes in Pull Request requires coverage by auto-tests Severity: S2 Major restrictions or short-term circumventions are required until a fix is available. Award: bug fix labels Mar 6, 2021
@mrtuvn mrtuvn force-pushed the move-assign-categories-to-beforeHtml branch from 7264026 to c0d7665 Compare March 7, 2021 17:34
@mrtuvn
Copy link
Contributor Author

mrtuvn commented Mar 7, 2021

@magento run all tests

@ihor-sviziev
Copy link
Contributor

Hi @vzabaznov @mslabko @sidolov @sivaschenko,
Could you provide some info on why the setting category_id was added in baebe46? Can it be moved to beforeToHtml as suggested in this PR?
Unfortunately, there no clear description and test coverage for these changes.

@ihor-sviziev ihor-sviziev added Auto-Tests: Covered All changes in Pull Request is covered by auto-tests and removed Auto-Tests: Not Covered Changes in Pull Request requires coverage by auto-tests labels Mar 9, 2021
@sivaschenko
Copy link
Member

@ihor-sviziev category_id setting was added as part of performance improvement

@ihor-sviziev
Copy link
Contributor

From @sivaschenko in slack:

This was a perfomance improvement for EE edition
I don’t think the change will break anything, but I will check with the author of the fix to make sure
The idea was to avoid calls to resource consuming $this->getCategoryIds() on each product

@ihor-sviziev ihor-sviziev added Severity: S3 Affects non-critical data or functionality and does not force users to employ a workaround. and removed Severity: S3 Affects non-critical data or functionality and does not force users to employ a workaround. labels Mar 10, 2021
Copy link
Contributor

@ihor-sviziev ihor-sviziev left a comment

Choose a reason for hiding this comment

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

✔ Approved

Note for QA: Please make sure this PR isn't introducing regression for performance improvement for the EE edition that was done in the scope of MC-33086.

@magento-engcom-team
Copy link
Contributor

Hi @ihor-sviziev, thank you for the review.
ENGCOM-8913 has been created to process this Pull Request

@sivaschenko sivaschenko added the Priority: P4 No current plan to fix. Fixing can be deferred as a logical part of more important work. label Mar 11, 2021
@ihor-sviziev ihor-sviziev mentioned this pull request Mar 30, 2021
16 tasks
@gabrieldagama gabrieldagama added Priority: P2 A defect with this priority could have functionality issues which are not to expectations. and removed Priority: P4 No current plan to fix. Fixing can be deferred as a logical part of more important work. labels Apr 6, 2021
@dmitriyprime dmitriyprime self-assigned this Apr 30, 2021
@dmitriyprime
Copy link
Contributor

✔️ QA passed

@m2-community-project m2-community-project bot added Progress: accept Severity: S3 Affects non-critical data or functionality and does not force users to employ a workaround. and removed Progress: ready for testing labels Apr 30, 2021
@ihor-sviziev
Copy link
Contributor

Moving back to "accept" status. It looks like it was moved by some mistake.

@magento-engcom-team magento-engcom-team merged commit e17dcca into magento:2.4-develop Jun 25, 2021
@m2-assistant
Copy link

m2-assistant bot commented Jun 25, 2021

Hi @mrtuvn, thank you for your contribution!
Please, complete Contribution Survey, it will take less than a minute.
Your feedback will help us to improve contribution process.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Auto-Tests: Covered All changes in Pull Request is covered by auto-tests Award: bug fix Component: Catalog Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Progress: accept Release Line: 2.4 Severity: S2 Major restrictions or short-term circumventions are required until a fix is available. Severity: S3 Affects non-critical data or functionality and does not force users to employ a workaround.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Breaking BC changes in the product list block
6 participants