- Issue created by @Etzesty
- 🇩🇪Germany jurgenhaas Gottmadingen
When using the switch user action then the current user (i.e. the logged in user) for that Drupal session is that user you switched to.
The contextual filter on the uid is correct, but it's default value should not be the current user, but the raw value 1. Then, your ECA model should provide the user ID as the argument to the view. Then you receive the comments for that user.
Still can't get it to work.
My ECA model must check every user, not only specific one, but because "Views: Execute query" action is not firing, I need to switch user to specific user.
(For example user1 posted several comments and user2 posted several comments as well. When cron is executing, i need to check comments from user1 and depending on calculation only from his comments, give him bonus. And I need to do the same action with user2)
This ECA is working with any other event, but not working with "Cron event".
(Added my ECA model, maybe it'll be easier to understand my goal here).Little bit thinking and I figured why it's not working like that.
When cron executes, current user is with id 0, and then it just doesn't know from where to load users.
So, I think, I need to load authors firstly, and after that load comments.- 🇩🇪Germany jurgenhaas Gottmadingen
So, I think, I need to load authors firstly, and after that load comments.
That's exactly it. Your first view should provide a list of users that have commented something. Then, your ECA model loops through all those users and loads their comments. With them, you can finally do your magic for each user and their comment(s).
Yeah, got it working smoothly.
Thank you @jurgenhaas for responses and appreciate your work on this module )- Status changed to Fixed
over 1 year ago 9:11pm 8 May 2023 Automatically closed - issue fixed for 2 weeks with no activity.