-
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
Execute collection tasks only when a valid collection is passed to th… #13574
Execute collection tasks only when a valid collection is passed to th… #13574
Conversation
…e data source of a UI Component form. This prevents ui forms not attached to collections to crash on filtering
|
->addFilter($filter); | ||
$dataProvider = $this->getContext()->getDataProvider(); | ||
if (isset($dataProvider->collection)) { | ||
$this->getContext()->getDataProvider() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe we don't need invoking $this->getContext()->getDataProvider()
once again since we have added $dataProvider
variable
@mgarciaavz thank you for your contribution. |
Thank you for your comment @rogyar, I already implemented as you mentioned and fixed the failing tests (still waiting for Travis' results 🤞) |
Hi @rogyar, thank you for the review. |
Hi @mgarciaavz. Unfortunately, the provided changes bring failing performance tests. The form UI component changes significantly slow down the rendering time: Server Side EE Admin Customer Management: So, we need to adjust the approach in order to avoid performance issues. Thank you. |
I'm closing this PR due to inactivity. Please, feel free to reopen it if you decide to proceed. Thank you |
Reopening this PR. I'll try a different approach. |
… an UI form uses a collection and avoid unexpected collection filtering errors
Hi @mgarciaavz , thanks for collaboration! If you'd like to continue working on this contribution, please port this pull request to 2.3-develop branch as this improvement should first be introduced to 2.3: https://devdocs.magento.com/guides/v2.2/contributor-guide/contributing.html#rules |
Hi @mgarciaavz , will you continue with the PR? |
Hi @mgarciaavz , I am closing this PR now due to inactivity. |
…e data source of a UI Component form. This prevents ui forms not attached to collections to crash on filtering
Description
There should be some check in order to perform collection actions only if the data source of UI Componet forms contents and actual valid collection, and avoiding them if not. This keeps model-collections forms working as usual, and avoids crashes on stand-alone forms.
Fixed Issues (if relevant)
Manual testing scenarios
Contribution checklist