Skip to content

Update ListProduct.php #32389

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

Merged
merged 2 commits into from
Mar 18, 2021

Conversation

mamsincl
Copy link
Contributor

@mamsincl mamsincl commented Mar 5, 2021

use current() method of ArrayIterator object instead of current() php function in Magento\Catalog\Block\Product\ListProduct
to prevent exception of Call to a member function getId() on bool using Magento 2.4.x with PHP7.4

Description

ArrayIterator PHP object behaves differently under PHP7.4 and PHP7.3.
With the earlier version, native PHP array functions (including current()) can handle object as array, but not with PHP7.4
Using object's implemented method instead of native function.

Related Pull Requests

Fixed Issues (if relevant)

  1. Fixes ArrayIterator incompatible method current() php 7.4 #32088

Manual testing scenarios (*)

  1. open previously broken PDP

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)
  • All automated tests passed successfully (all builds are green)

use `current()` method of ArrayIterator object instead of `current()` php function
@m2-assistant
Copy link

m2-assistant bot commented Mar 5, 2021

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

@mamsincl
Copy link
Contributor Author

mamsincl commented Mar 5, 2021

@magento run all tests

@mamsincl
Copy link
Contributor Author

mamsincl commented Mar 7, 2021

@magento run Functional Tests EE, Unit Tests, WebAPI Tests

@mamsincl
Copy link
Contributor Author

mamsincl commented Mar 7, 2021

I checked All automated tests passed successfully (all builds are green) checkbox, as the small modification of the PR does not introduce any new public method which requires any additional automated/functional/unit tests

The failed tests - might be caused by the general condition of branch 2.4-develop - are:

  • Functional Tests EE
  • Unit Tests
  • WebAPI Tests

Update
related unit test checked, modified and PRd, awaiting test results

modify return value of GetIteration on catCollectionMock
@mamsincl
Copy link
Contributor Author

mamsincl commented Mar 8, 2021

@magento run all tests

@mamsincl
Copy link
Contributor Author

mamsincl commented Mar 8, 2021

Failed tests re-triggered
@magento run Functional Tests EE, Functional Tests B2B

note:

  • previously succeeded Functional Tests B2B failed as Admin user create Partial Invoice for order with Virtual product on Custom stock from Main Website - not related
  • Functional Tests EE failed as Apply Catalog Price Rule in Magento EE - not related

@mamsincl
Copy link
Contributor Author

mamsincl commented Mar 8, 2021

I am marking PR as all automated test passed successfully: Functional Tests EE failed a different reason this time, re-triggered again (and last time)

@magento run Functional Tests EE

note:

  • Functional Tests EE failed as MC-32285: Product Source Grid Verification for multiple product sources.

@ihor-sviziev ihor-sviziev added Severity: S2 Major restrictions or short-term circumventions are required until a fix is available. Auto-Tests: Covered All changes in Pull Request is covered by auto-tests Award: bug fix Award: test coverage labels Mar 9, 2021
@magento-engcom-team
Copy link
Contributor

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

@magento-engcom-team
Copy link
Contributor

@mamsincl thank you for contributing. Please accept Community Contributors team invitation here to gain extended permissions for this repository.

@sivaschenko sivaschenko added the Priority: P2 A defect with this priority could have functionality issues which are not to expectations. label Mar 11, 2021
@brucemead
Copy link
Contributor

Please add Ayko Partner label.

@ihor-sviziev
Copy link
Contributor

@sidolov @gabrieldagama, could you check with author why partner label not assigned automatically?

@brucemead
Copy link
Contributor

@ihor-sviziev I've just added @mamsincl to our team so that will be why

@magento-engcom-team magento-engcom-team added Partner: AYKO partners-contribution Pull Request is created by Magento Partner labels Mar 11, 2021
@magento-engcom-team
Copy link
Contributor

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

@engcom-Oscar
Copy link

@engcom-Foxtrot can you please check this PR, it require dev-experience.

@engcom-Foxtrot
Copy link
Contributor

QA passed

@engcom-Foxtrot engcom-Foxtrot added the QA: Ready to add to Regression Scope Should be analyzed and added to Regression Testing Scope(if applicable) label Mar 16, 2021
@engcom-Oscar engcom-Oscar added QA: Added to Regression Scope Scenario was analysed and added to Regression Testing Scope and removed QA: Ready to add to Regression Scope Should be analyzed and added to Regression Testing Scope(if applicable) labels Mar 17, 2021
@magento-engcom-team magento-engcom-team merged commit 47fff39 into magento:2.4-develop Mar 18, 2021
@m2-assistant
Copy link

m2-assistant bot commented Mar 18, 2021

Hi @mamsincl, 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 Award: test coverage Component: Catalog Partner: AYKO partners-contribution Pull Request is created by Magento Partner Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Progress: accept QA: Added to Regression Scope Scenario was analysed and added to Regression Testing Scope Release Line: 2.4 Severity: S2 Major restrictions or short-term circumventions are required until a fix is available. Type: Bug Fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ArrayIterator incompatible method current() php 7.4
8 participants