Hi,
It seems to me that Background tasks are scheduled with Cron, then the parameters that are read will belong to the last logged in user instead of the admin user.
This causes problems, because if the logged in user has Not Receive His Emails set to Yes, then when new objects (eg. Ticktes) are created then an email won't be sent.
Is it possible to change this behaviour?
Regards,
Zsolt
If I remember correctly, cronned email are sent as admin.
But you're right, if admin has set "Not Receive His Emails" to Ys, emails may not be sent.
Ticket #4408 recorded.
I logged the session user from Cron.php with:
$tmp_uid=getSessionUser()->id;
debugTraceLog("SessionUserId: $tmp_uid");
$tmp_sid=session_id();
debugTraceLog("SessionId: $tmp_sid");
When I started the session with the admin user, I got:
2020-01-02 18:44:46.454 ----- DEBUG ----- SessionUserId: 1
2020-01-02 18:44:46.454 ----- DEBUG ----- SessionId: 7oh8hl08rs9csam21r1d73io9j
After I logged in with user no. 7, I got:
2020-01-02 18:55:10.430 ----- DEBUG ----- SessionUserId: 7
2020-01-02 18:55:10.430 ----- DEBUG ----- SessionId: jelaud20d00savspok904u1bqs
Regards,
Zsolt
It seems to me that when I log in in with a new user, then the cron session is restarted:
2020-01-02 19:06:53.543 ..... SCRIPT .... 172.29.25.180 =====/projeqtor/view/menuNotificationRead.php
2020-01-02 19:06:53.548 ..... SCRIPT .... 172.29.25.180 Page=menuNotificationRead.php
2020-01-02 19:06:53.548 ..... SCRIPT .... 172.29.25.180 refreshParameters()
2020-01-02 19:06:53.556 ..... SCRIPT .... 172.29.25.180 getProfile(objectOrIdProject=Audit #452)
2020-01-02 19:06:53.556 ..... SCRIPT .... 172.29.25.180 getProfile(objectOrIdProject=Audit #452)
2020-01-02 19:06:57.274 ----- DEBUG ----- Cron possibly running twice
2020-01-02 19:06:57.275 ----- DEBUG ----- current process ID is 879
2020-01-02 19:06:57.275 ----- DEBUG ----- current unique ID is 5e0e30cec37667.39453628
2020-01-02 19:06:57.275 ----- DEBUG ----- running process ID is 29931
2020-01-02 19:06:57.275 ----- DEBUG ----- running unique ID is 5e0e313d0a4ce1.50314662
2020-01-02 19:06:57.275 ----- DEBUG ----- => stopping current Cron
2020-01-02 19:06:57.825 ..... SCRIPT .... 172.29.25.180 Page=checkAlertToDisplay.php
I may find what the problem is:
https://www.projeqtor.org/en/forum/2-submit-issues/10465-running-of-cron-is-not-correctly-checked#26182