-
Notifications
You must be signed in to change notification settings - Fork 9
Check if key is defined befory loading the entity, fix array_flip warning #2
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
base: 8.x-1.x
Are you sure you want to change the base?
Conversation
foreach ((array) $keys as $key) { | ||
$value = NULL; | ||
|
||
if (NULL !== $entityTypeStorage) { |
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.
Why not add the $key
empty check to the condition above?
@joelpittet good point, I moved the |
Thanks for this PR! I will test out the change and get it merged ASAP. |
I get this warning. Will any of the above fix this warning. Tried the above but to no avail. Warning: array_flip(): Can only flip STRING and INTEGER values! in Drupal\Core\Entity\EntityStorageBase->loadMultiple() (line 264 of core/lib/Drupal/Core/Entity/EntityStorageBase.php).
Drupal\Core\Entity\EntityStorageBase->loadMultiple(Array) (Line: 249)
Drupal\Core\Entity\EntityStorageBase->load() (Line: 460)
Drupal\views_selective_filters\Plugin\views\filter\Selective->getOids() (Line: 86)
Drupal\views_selective_filters\Plugin\views\filter\Selective->getValueOptions() (Line: 114)
Drupal\views_selective_filters\Plugin\views\filter\Selective->valueForm(Array, Object) (Line: 861)
Drupal\views\Plugin\views\filter\FilterPluginBase->buildExposedForm(Array, Object) (Line: 96)`
...
... |
@jvandenrym yes it should be fixed on this is merged, at least your error message seems to be exactly what I had before. |
This change fixes the array_flip error on my use-case, too. Can it be merged? Thank you! |
On a view with multiple selective filters I had this warning showing up (only for anonymous users):
It appears that the
$key
was sometimes false.