- Issue created by @mschudders
- 🇧🇪Belgium mschudders
Before:
if ($value) { $storage = \Drupal::entityTypeManager()->getStorage($entity_type); $entity = $storage->load($value); $form['override'][$block->getDerivativeId()][$type][$id]['value']['#default_value'] = $entity; }
After:
if ($value) { $storage = \Drupal::entityTypeManager()->getStorage($entity_type); $values = preg_split("/[\+,]+/", $value) ?: []; $default = $storage->loadMultiple($values); $form['override'][$block->getDerivativeId()][$type][$id]['value']['#default_value'] = $default; }
- 🇧🇪Belgium mschudders
todo have to test mixing "+" and ",".
Right now tested "+" and "single values"
- 🇧🇪Belgium arwillame Belgium 🇧🇪
I had some issues testing your proposition.
The form configuration do not allowed me to have multiple values in the "entity_autocomplete".So i created a patch that allow the user to add multiple entities using the "#tags" parameter.
I also add a check to only do that when the related view allow ultiple elements.Finally i made a little change in the execute method to be able to use the multiple values in the context filter itself.
Please feel free to comment my proposition.
- Status changed to Needs work
3 months ago 7:07am 18 April 2025 - 🇧🇪Belgium tim-diels Belgium 🇧🇪
Please provide a MR for this so this will run the pipelines.
- First commit to issue fork.
- 🇧🇪Belgium matthijs
matthijs → changed the visibility of the branch 1.2.x to hidden.
- Merge request !41Issue #3413353 by arwillame, Matthijs: Add support for multiple values → (Open) created by matthijs
- 🇧🇪Belgium matthijs
Created an MR from arwillame's changes and did some minor improvements.