-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Custom admin UI component grid breaks when collection is not AbstractDb #32292
Comments
Hi @zaximus84. Thank you for your report.
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:
For more details, please, review the Magento Contributor Assistant documentation. Please, add a comment to assign the issue:
🕙 You can find the schedule on the Magento Community Calendar page. 📞 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. 🎥 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 |
The exact same problem was discovered in baldwin-agency/magento2-module-url-data-integrity-checker#16 If you wrap that contents of that public function applyFilters(Collection $collection, SearchCriteriaInterface $criteria)
{
if (method_exists($collection, 'getSelect')) {
...
}
} But the type checking on @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.
|
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. The problem is triggered from a custom collection that is used by a grid datasource and inherits from The change in 2638e0f#diff-589c211efb97038b69ed19a3bbfa83af013eacf4c8f218cb8f3705aaef675543 to the 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 |
✅ Jira issue https://jira.corp.magento.com/browse/AC-1013 is successfully created for this GitHub issue. |
✅ Confirmed by @engcom-Lima. Thank you for verifying the issue. |
❌ Cannot export the issue. This GitHub issue is already linked to Jira issue(s): https://jira.corp.magento.com/browse/AC-1013 |
❌ 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 (*)
Exception in /var/www/html/vendor/magento/framework/View/Element/UiComponent/DataProvider/FilterPool.php:45
This issue was introduced in 2.4.2 due to changes in the FilterPool class. See this commit: 2638e0f
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.
The text was updated successfully, but these errors were encountered: