Misleading debug message from the load entity plugin

Issue information

From user: jurgenhaas

Related to !213 (merged)

Contribution record

Fork management

Problem/Motivation

Using the plugin eca_token_load_entity will use its access check to verify whether the given configuration can load an entity. If not, it returns FALSE and the processor in \Drupal\eca\Entity\Objects\EcaAction::execute will generate a warning Access denied to %actionlabel (%actionid) from ECA %ecalabel (%ecaid) for event %event. and will not execute the action.

This is completely misleading, and we should review how this could be better solved.

Proposed resolution

There are 3 possible way to go about that one:

  • Either we do not check access and let it cancel the process when it realizes in the action execute function, that no entity can be loaded. That could then output a warning stating exactly that.
  • Or we extend the current functionality of the access control:
    • If it's able to load the entity, it returns whether the current user has view access to that entity
    • otherwise it still returns FALSE, but in addition, the processor referred to above should be smarter and provide variable warnings. The default warning could remain as is, but if the action provides a callback with a different message, that would be used instead

The third option is my preference, and it shouldn't be too hard to implement.

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