- Issue created by @patricion
- π©πͺGermany jurgenhaas Gottmadingen
Are you probably looking for the Entity: load action?
- πΊπ¦Ukraine patricion
Yes, I use Entity: load, but for some reason I get an error in the eca debug log that Access denied to Entity: load even if it is made from admin
- πΊπ¦Ukraine patricion
Yes, I use Entity: load, but for some reason I get an error in the eca debug log that Access denied to Entity: load even if it is made from admin.
admin 15:41:46 Access denied to Entity: load (Activity_0rviqx6) from ECA noname (process_l5ny2hh) for event Drupal\eca_queue\Event\ProcessingTaskEvent: No entity available. - π©πͺGermany jurgenhaas Gottmadingen
Yes, from the configuration I can see that the action is configured to load an entity, but it doesn't tell which one. You probably want to load the entity by its entity ID? Then you need to configure the load action accordingly.
- πΊπ¦Ukraine patricion
Yes, thanks for the help, I set up entity:load by id and it worked for me. The only problem is that I don't know how to configure Entity: load to load the order of the user whose token I loaded into user1. I have attached a screenshot of how I configured entity load, and it does not work as it should because it takes the user's id as the order's id. I tried to add the user id not in the entity id but in the entity, then it gives an error and does not load. I would be very grateful if you could help me with the correct configuration of Entity: load
- π©πͺGermany jurgenhaas Gottmadingen
You want to load an order entity, then you have to provide the ID of the order entity in the field "Entity ID".
- πΊπ¦Ukraine patricion
I'm sorry, maybe I didn't quite understand what you're talking about, I tried to use your method by specifying the [commerce_order:order_id] token, but I get the same error. And I can't specify a plain text id
- π©πͺGermany jurgenhaas Gottmadingen
That token is not available by itself, that's why it won't provide you any value.
To learn how to make tokens available, maybe the Tokens chapter in the ECA Guide may be helpful.
- Status changed to Fixed
11 months ago 12:45pm 25 January 2024 - π©πͺGermany jurgenhaas Gottmadingen
That's good to know, thanks for your feedback.
- πΉπThailand AlfTheCat
I might be able to add something here, as I am making a new model that reacts to "order is paid" and I noticed that the "[entity]" token does not work. Tokens like "[commerce-order:]" do work. So when I create an action, "Entity: load", and I specify "[entity:order_id"] it will not work, but when I use [commerce-order:order_id] it does load the order entity.
The documentation states that:
When an entity related event gets triggered, e.g. Presave content entity, then ECA automatically puts the related entity onto the token stack with the name entity and also under the name of the entity type, e.g. node, user, etc.
...so perhaps we do have a bug here.
- πΉπThailand AlfTheCat
I made another discovery here, I could not get the action "Get field value" to work, to build a list of order_items until I specified "commerce_order" as the entity to act on. Leaving that field empty made the action not execute.
Hence it really seems that the "entity" token is empty, and that causes problems with certain actions, including "Entity:load".
I am on 1.x dev so apologies if this is fixed in the 2.x branch.
- π©πͺGermany jurgenhaas Gottmadingen
@AlfTheCat this really sounds like a bug, but not really related to this issue. So, it would be great to open a new issue as a bug report for that.
- πΉπThailand AlfTheCat
Hi Jurgen,
Thank you, and done: π "entity" token is not set Active .
Automatically closed - issue fixed for 2 weeks with no activity.