Skip to content

Conversation

artskirk
Copy link

Description (*)

There is an issue with types in \Magento\GroupedProduct\Model\Product\Type\Grouped class, in method _prepareProduct. A variable can be set as false, and is then used in a foreach, so I have update it to array type.

Related Pull Requests

Fixed Issues (if relevant)

  1. Fixes PHP8.1 type bugfix #35808

Manual testing scenarios (*)

Call \Magento\GroupedProduct\Model\Product\Type\Grouped::__prepareProduct method

Expected result

The following issue have to be fixed:

.CRITICAL: Exception: Warning: foreach() argument must be of type array|object, bool given in /var/www/html/vendor/magento/module-grouped-product/Model/Product/Type/Grouped.php on line 391

Questions or comments

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)
  • README.md files for modified modules are updated and included in the pull request if any README.md predefined sections require an update
  • All automated tests passed successfully (all builds are green)

@m2-assistant
Copy link

m2-assistant bot commented Jul 29, 2022

Hi @artskirk. 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

ℹ️ Run only required test builds during development. Run all test builds before sending your pull request for review.

For more details, 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, join the Community Contributions Triage session to discuss the appropriate ticket.

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

@m2-community-project m2-community-project bot added Priority: P3 May be fixed according to the position in the backlog. Progress: pending review labels Jul 29, 2022
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.

hi @artskirk,
Could you please cover your changes with any type of automated tests?

@ihor-sviziev ihor-sviziev added Risk: low Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Award: bug fix Auto-Tests: Not Covered Changes in Pull Request requires coverage by auto-tests and removed Priority: P3 May be fixed according to the position in the backlog. labels Aug 1, 2022
@ihor-sviziev ihor-sviziev removed their assignment Aug 22, 2022
@hostep hostep mentioned this pull request Oct 10, 2024
5 tasks
@engcom-Hotel engcom-Hotel self-requested a review October 15, 2024 09:41
@engcom-Hotel
Copy link
Contributor

@magento run all tests

@engcom-Hotel
Copy link
Contributor

Hello @artskirk,

Have you got a chance to check the review comment made by @ihor-sviziev here?

Thanks

@ihor-sviziev ihor-sviziev removed the Auto-Tests: Not Covered Changes in Pull Request requires coverage by auto-tests label Oct 15, 2024
@ihor-sviziev
Copy link
Contributor

ihor-sviziev commented Oct 15, 2024

@engcom-Hotel I think covering this case would be pretty hard, so I would accept it as is since it's pretty low-risk change.

@ihor-sviziev
Copy link
Contributor

@magento run all tests

@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 Oct 23, 2024
@engcom-Dash engcom-Dash self-assigned this Oct 23, 2024
@engcom-Dash
Copy link
Contributor

@magento run all tests

@engcom-Dash
Copy link
Contributor

Manual testing is not required since this change ensures that $associatedProducts is always an array when used in the foreach loop.

Builds are failed, hence moving it to Extended Testing.

@engcom-Dash
Copy link
Contributor

@magento run all tests

@engcom-Dash
Copy link
Contributor

Got the green build so moving it to merge in progress.
image

@engcom-Dash
Copy link
Contributor

@magento run all tests

@magento-devops-reposync-svc magento-devops-reposync-svc merged commit c3ea0bb into magento:2.4-develop May 19, 2025
10 of 12 checks passed
@ct-prd-projects-boards-automation ct-prd-projects-boards-automation bot moved this from Merge in Progress to Recently Merged in Pull Requests Dashboard May 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Award: bug fix Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Progress: accept Risk: low Triage: Dev.Experience Issue related to Developer Experience and needs help with Triage to Confirm or Reject it
Projects
Status: Recently Merged
Development

Successfully merging this pull request may close these issues.

PHP8.1 type bugfix
6 participants