We updated our site from Drupal core 10.2.7 and Hook event dispatcher 4.0.0-rc1 to Drupal core 10.3.6 and Hook event dispatcher 4.2.0.
After this update when editing a view we get the following error:
TypeError: Drupal\core_event_dispatcher\Event\Entity\EntityBuildDefaultsAlterEvent::__construct(): Argument #3 ($viewMode) must be of type string, false given, called in /var/www/html/builds/2024-10-30.09-16-57.commit--d74fa86d8/web/modules/contrib/hook_event_dispatcher/src/Plugin/Factory/EventFactory.php on line 26 in Drupal\core_event_dispatcher\Event\Entity\EntityBuildDefaultsAlterEvent->__construct() (line 34 of /var/www/html/builds/2024-10-30.09-16-57.commit--d74fa86d8/web/modules/contrib/hook_event_dispatcher/modules/core_event_dispatcher/src/Event/Entity/EntityBuildDefaultsAlterEvent.php).
The view is quite complicated with custom processing and for example I wonder if for example the usage of https://www.drupal.org/project/entity_reference_display → or https://www.drupal.org/project/viewsreference/ → might be related. The view mode does have a view mode selected for the entities but it can be overridden.
This error is not visible in production with the previous version but it's visible in staging after the update.
-
-
-
-
-
-
Active
4.2
Code