- Issue created by @simone.gritsch
- ๐ฉ๐ชGermany jurgenhaas Gottmadingen
That sounds like your model is getting in conflict with caching.
Could you please confirm that if you flush all caches, that it works once afterwards, and then it doesn't any more? Is this reproducible?
- ๐ฆ๐นAustria simone.gritsch
Hi Jรผrgen,
thanks for your quick response. I tried flushing the cache, but not really with a satisfying outcome.
My user-id was inserted in the id-field so my user should be able to open the request.
On the first click I got redirected.
On the second click I can open the request.
When I delete the cache on the first click I get redirected again altough I should be able to see it.How would you build the ECA-model?
We used "view content entity" and "Compare field value" with expected field value [current-user:id].Thank you!
- ๐ฉ๐ชGermany jurgenhaas Gottmadingen
The event
view content entity
is not what you want at this point, as it's not just dispatched when viewing the node's canonical page. This event is triggered whenever an entity gets rendered for viewing, i.e. if you have a view that lists entities, this event gets dispatched for each contained entity in that view.The described use case seems to be about a http request to the canonical page of a node, e.g. /node/1234
For that, you should start with the
Controller found to handle request
event and then use a conditionRoute match
to check if the request is for theRoute name = entity.node.canonical
. If true, you can then load the node into a token with theToken: load route parameter
to continue with that for further processing. - ๐ฆ๐นAustria simone.gritsch
Hi Jรผrgen,
we tried your suggestion today but are really unsure what we have to insert in the fields: Name of route parameter and: Name des Tokens.
Moreover we are not sure how the routine is validating which user is trying to access the data.Would it be possible to contact you directly for support? Or is there a documentation where this kind of case is documented?
We really appreciate your support!!
All the best - ๐ฉ๐ชGermany jurgenhaas Gottmadingen
we tried your suggestion today but are really unsure what we have to insert in the fields: Name of route parameter and: Name des Tokens.
That should be
node
. The routes in Drupal are defined like e.g./node/{node}/edit
where the{node}
is a route parameter that can be used.Moreover we are not sure how the routine is validating which user is trying to access the data.
There is always a token
current_user
which contains the user entity of the current user.Would it be possible to contact you directly for support? Or is there a documentation where this kind of case is documented?
Best way is asking questions here, to refer to the ECA Guide and maybe also ask questions in the ECA channel on Drupal Slack, where many other users are online as well, who can help.
- Status changed to Postponed: needs info
over 1 year ago 9:40am 30 June 2023 - Status changed to Closed: outdated
over 1 year ago 1:43pm 3 August 2023