- 🇧🇪Belgium fernly
Updated patch to fix issue when non-existing nodes are trying to be loaded in the autocomplete callback.
Error: Call to a member function label() on null in Drupal\search_overrides\Form\SearchOverrideForm->addAutocomplete() (line 110 of .../modules/contrib/search_overrides/src/Form/SearchOverrideForm.php).
This is in fact a separate bug, but 2 separate patches could not be applied on top of each other
The added fix:
File: src/Form/SearchOverrideForm.php
if ($key = $element['#default_value']) { $entity = $this->getEntityFromValue($key); - $element['#default_value'] = $entity->label() . ' (' . $key . ')'; + if ($entity) { + $element['#default_value'] = $entity->label() . ' (' . $key . ')'; + } }