Open zaximus84 opened 3 years ago
Hi @zaximus84. 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.
Please, add a comment to assign the issue: @magento I am working on this
Join Magento Community Engineering Slack and ask your questions in #github channel.
:warning: According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.
:clock10: You can find the schedule on the Magento Community Calendar page.
:telephone_receiver: The triage of issues 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.
:movie_camera: You can find the recording of the previous Community Contributions Triage on the Magento Youtube Channel
:pencil2: Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel
The exact same problem was discovered in https://github.com/baldwin-agency/magento2-module-url-data-integrity-checker/issues/16
If you wrap that contents of that applyFilters
method in something like the following, it no longer crashes, but I have no idea if that would be considered a good solution:
public function applyFilters(Collection $collection, SearchCriteriaInterface $criteria)
{
if (method_exists($collection, 'getSelect')) {
...
}
}
But the type checking on AbstractDb
could be a solution as well...
@engcom-Golf: what do you think might be a good solution here?
Hello. Faced this issue when going to Report->Braintree Settlement grid. And I can reproduce this problem on a clean Magento 2.4.2 installation!
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!
Issue is definitely not stale, leaving a comment to not close it.
@Den4ik: can we get somebody to review this and propose a solution? I'm willing to create a PR for this if a good solution can be proposed, thanks!
We needed to add a silly workaround to keep our module working on 2.4.2 because of this bug: https://github.com/baldwin-agency/magento2-module-url-data-integrity-checker/pull/17/files
Hi @engcom-Echo. 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:
[ ] 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).Details
If the issue has a valid description, the label Issue: Format is valid
will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid
appears.
[ ] 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description
label to the issue by yourself.
[ ] 3. Add Component: XXXXX
label(s) to the ticket, indicating the components it may be related to.
[ ] 4. Verify that the issue is reproducible on 2.4-develop
branchDetails
- Add the comment @magento give me 2.4-develop instance
to deploy test instance on Magento infrastructure.
- If the issue is reproducible on 2.4-develop
branch, please, add the label Reproduced on 2.4.x
.
- If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!
[ ] 5. Add label Issue: Confirmed
once verification is complete.
[ ] 6. Make sure that automatic system confirms that report has been added to the backlog.
I confirm that the error is still valid. All magento 2.4.2 stores have this bug when going to Report->Braintree Settlement grid.
Hi @zaximus84 ,
On step 3 , Can you please specify which collection you used for the data provider.
Thanks
Hi @engcom-Echo
If you need an easy way to reproduce: install version 1.2.0 of this open source module on Magento 2.4.1. Then in the backoffice of Magento, go to Catalog > Data Integrity Checker and click on one of the 4 submenu's and notice that the page doesn't crash. Now do the same on Magento 2.4.2 and notice that those pages now suddenly start crashing.
The problem is triggered from a custom collection that is used by a grid datasource and inherits from Magento\Framework\Data\Collection
.
The change in https://github.com/magento/magento2/commit/2638e0ffae57f351c512e47a0295d4c2d376681a#diff-589c211efb97038b69ed19a3bbfa83af013eacf4c8f218cb8f3705aaef675543 to the applyFilters
method introduced the problem in Magento 2.4.2. The new code assumes that $collection
always has a getSelect
method. But $collection
can be either a Magento\Framework\Data\Collection\AbstractDb
or a Magento\Framework\Data\Collection
.
For the AbstractDb
, it indeed has a getSelect
method, see here. But the Collection
class - or its parents - does not have a getSelect
method.
So the code that was introduced in https://github.com/magento/magento2/commit/2638e0ffae57f351c512e47a0295d4c2d376681a#diff-589c211efb97038b69ed19a3bbfa83af013eacf4c8f218cb8f3705aaef675543 will crash for all instances of $collection
that aren't an AbstractDb
.
Hope this makes the problem even more clearer then it already was.
@magento give me 2.4-develop instance - upcoming 2.4.x release
Hi @sumeshkumar577. Thank you for your request. I'm working on Magento instance for you.
Hi @sumeshkumar577, here is your Magento Instance: https://be40c214bcd2354840529352e557ece0-2-4-develop.instances.magento-community.engineering Admin access: https://be40c214bcd2354840529352e557ece0-2-4-develop.instances.magento-community.engineering/admin_217a Login: 36258fb1 Password: cb405403b4f0
:white_check_mark: Jira issue https://jira.corp.magento.com/browse/AC-1013 is successfully created for this GitHub issue.
:white_check_mark: Confirmed by @engcom-Lima. Thank you for verifying the issue.
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.
:x: Cannot export the issue. This GitHub issue is already linked to Jira issue(s): https://jira.corp.magento.com/browse/AC-1013
:x: Cannot export the issue. This GitHub issue is already linked to Jira issue(s): https://jira.corp.magento.com/browse/AC-1013
Preconditions (*)
Steps to reproduce (*)
Expected result (*)
Actual result (*)
This issue was introduced in 2.4.2 due to changes in the FilterPool class. See this commit: https://github.com/magento/magento2/commit/2638e0ffae57f351c512e47a0295d4c2d376681a
The applyFilters method type hints that the $collection argument can be an instance of Magento\Framework\Data\Collection or Magento\Framework\Data\Collection\AbstractDb, but the method executes operations that are only guaranteed on AbstractDb (i.e. getSelect).
Any AbstractDb operations should only be executed after some sort of type check to prevent errors for collections that don't extend that abstract. As an example, I built an admin grid that populates data from a remote API and has no need of a database select object, so it doesn't extend AbstractDb.
Please provide Severity assessment for the Issue as Reporter. This information will help during Confirmation and Issue triage processes.