Check events against the triggered event name

Issue information

From user: jurgenhaas

Related to !95 (merged)

Contribution record

Fork management

Problem/Motivation

The method \Drupal\eca\EventSubscriber\EcaBase::onEvent currently handles only the event object, that's being passed on by \Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher::dispatch. That dispatcher also passes on the event name and the context.

We should also handle the event name as the second argument, pass that on to the processor and from there to \Drupal\eca\Entity\EcaStorage::loadByEvent to only load those event, that really are used in models.

Ran into that issue while implementing eca_state_machine where they have one event class WorkflowTransitionEvent which is used with a huge variety of event names. But those event names are not included anywhere other than that second argument described above.

I'll post a fix, shouldn't be that difficult.

Edited by drupalbot
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information