-
-
Notifications
You must be signed in to change notification settings - Fork 850
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
Revert using defaults.order as collection.order #4178
Conversation
guilliamxavier
commented
Mar 31, 2021
Q | A |
---|---|
Branch? | 2.6 |
Bug fix? | yes |
New feature? | no |
Deprecations? | no |
Tickets | Fix #4170 |
License | MIT |
Doc PR |
@@ -58,7 +58,7 @@ public function applyToCollection(Builder $aggregationBuilder, string $resourceC | |||
if (empty($defaultOrder)) { | |||
$defaultOrder = $this->resourceMetadataFactory->create($resourceClass)->getAttribute('order'); | |||
} | |||
if (\is_array($defaultOrder)) { | |||
if (null !== $defaultOrder) { |
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.
Isn't it better to keep is_array
?
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 don't know, because:
- I consistently reverted all the changes of 3492922
- With
null !==
(like it was originally) an incorrect config (e.g. a string value) gives you a Warning "Invalid argument supplied for foreach()" (then you fix your config 😉), withis_array()
it is silently ignored (until you notice your config isn't applied? 😕) - See also Fix behaviour of "order" attribute #3472
But if you deem this part of the revert too risky, I can drop it (just say it)
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.
Not sure which one is the better 😅 Keep it like this, it's alright.
Thanks 🙂 |