Idea to make ECA quick actions more flexible

Created on 19 February 2025, about 2 months ago

Hey there,
first of all the idea of having quick actions for eca is brilliant and I really like it. I tested the module a little bit and I love it. The idea of making quick action more scalable and flexible got stuck in my head.

My approach would be to make the quick actions discoverable by an annotation. This would give us the advantage of placing the action logic not in a static file within a static file path, so we can place them in custom modules for example.

The point is that the current annotation discovery system can only find annotations on plugins, (correct me when I'm wrong) which is outside of the main business logic you intentionally designed. Don't get me wrong I like the idea of have it quick and simple, but why not making our own annotation discovery?

So my fingers got a little itchy and I started coding a little bit.
I'm not done yet, but I thought I could present you my idea to discuss it with you :).

I'd happy to have some feedback :).

Feature request
Status

Active

Version

2.0

Component

Code

Created by

🇩🇪Germany Istari

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @Istari
  • 🇻🇳Vietnam zipme_hkt

    Hi @mysdiir

    It nice that you interesting with my ECA quick actions idea.

    My idea about ECA quick actions that help me can use exist function in the Drupal and other contrib modules function without need define custom module.

    With your idea when create custom annotation in your custom module for quick action you can directly create ECA Action plugin will better.

    But for your idea I think we can create other EAC action called
    ECA Helper: Quick Service Action
    with input are service name, service function name and parameters like current ECA Quick Action

    There are 2 points here:
    - User can input any service and function in the Quick Service Action, but it may concern with the security when user can access to any Drupal service.
    -In custom module you can create a service with custom tag like "eca_quick_action" the module will automatic scan these service and allow user can select defined with tag "eca_quick_action"

    Please give me your thought with my above comment.
    Best regards.

  • 🇩🇪Germany Istari

    Sry for my late reply.

    Your Idea sounds good, so we don't need a custom discovery system, which would lower the complexity.
    From a technical and security point of view we need to make sure to drastically limit the user input.

    My first thought would be something like a switch case that uses the user input from the configuration form to execute function. Something like:

    function foo() {
        echo "foo";
    }
    
    function bar() {
        echo "bar";
    }
    
    $input = "foo";
    
    switch ($input) {
        case 'foo':
            foo();
            break;
        case 'bar':
            bar();
            break;
        default:
            echo "Error.";
    }

    But I am not sure if this would be a propper way.
    Also in terms of security my expertise is too low to determine the conditions to keep it safe and secure.

  • 🇩🇪Germany Istari

    Holy what happend with my intro text?

Production build 0.71.5 2024