- Issue created by @mlncn
- ๐บ๐ธUnited States mlncn Minneapolis, MN, USA
This is pretty weird thoughโ adding an explicit 'full' view mode to the content type in question did not help, did not expect it to, but there are no models configured that have anything to do with eca.content_entity.view_mode_alter.
Could i have an unconfigured event that's firing for all possible events somehow?
- ๐ฉ๐ชGermany jurgenhaas Gottmadingen
This is long before an ECA model comes into play. When this code gets executed, this is when Drupal core calls the
hook_entity_view_mode_alter()
. ECA is dispatching an event for that hook, so that models could subscribe to that event.The stack trace above means, that the following code in
\Drupal\eca_content\HookHandler::viewModeAlter
can not dispatch the required event:$event = $this->triggerEvent->dispatchFromPlugin('content_entity:viewmodealter', $entity, $this->entityTypes, $view_mode);
That's then returning
$event = NULL
and that's then causing the exception.Now, it's strange that your Drupal installation can not dispatch that event, as it is always dispatched everywhere and we've never seen that error before.
The problem is in
\Drupal\eca\Event\TriggerEvent::dispatchFromPlugin
and you should go there with either xdebug or with some extra logging core in the try/catch scenario to find out what's exactly happening there. You could e.g. replace the catch part with the following code to get an extra output in your Drupal logs:catch (PluginException $ex) { \Drupal\Core\Utility\Error::logException(\Drupal::logger('ECA Debug'), $ex); return NULL; }