- π¬π§United Kingdom danharper
I've tried the above but when I edit a node and save it nothing happens.
Tried using XDEBUG in the entityUpdate function but it never gets there.
Receiving a fatal error when installing this module via an automated deployment. (Using Ansible in my case).
Problem is the same outlined in
#3200062 β
, where there is a problem with the autoloader when a custom module, that is already installed, is using constants from EntityHookEvents
for subscribed events. After "composer install" that class is expected, but isn't yet available to the "container" because the drupal/hook_event_dispatcher" module has not yet been installed. (often via drush cim
)
This results in an error:
Error: Class \Drupal\core_event_dispatcher\EntityHookEvents not found
Note:
My (not ideal) workaround is to hard-code the events, for example:
public static function getSubscribedEvents(): array
{
// Hardcoded events due to autoloading issue, @see: https://www.drupal.org/project/drupal/issues/2825358
return [
'hook_event_dispatcher.entity.insert' => 'entityInsert',
'hook_event_dispatcher.entity.delete' => 'entityDelete',
'hook_event_dispatcher.entity.presave' => 'entityPreSave',
'hook_event_dispatcher.entity.update' => 'entityUpdate',
];
}
Active
3.2
Code
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
I've tried the above but when I edit a node and save it nothing happens.
Tried using XDEBUG in the entityUpdate function but it never gets there.