-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
task_reminder.php not sending reminders? #654
Comments
I think this is caused by the new note-visibility feature ("notes assigned to me") which means the abstract_note table is now a view. Working on a fix now. |
Same root cause as #652 |
This fix will be in the next release. You can fix it in the interim you can run the following SQL (which won't interfere with the fortcoming upgrade)
|
Thanks for the fix. I applied it the other day, and I think that is what has triggered errors when we edit. Wondering how to 'undo' the fix to see if that will remove the new errors. This is a snippet of the error email I receive (multiple times.. ie 30 emails after one edit). The edit appears to be made tho? And It looks like a problem with all the custom fields associated with the person. ====================================================================== USER: 1 REQUEST: [custom_12_m] => Array [custom_12_y] => Array [custom_42] => Array [custom_35] => Array [custom_43] => Array [custom_44] => Array [custom_38] => Array [custom_38_other] => Array [custom_45] => Array [custom_46] => Array [custom_41] => Array [custom_36] => Array [custom_47] => Array [custom_48] => Array [custom_49_d] => Array [custom_49_m] => Array [custom_49_y] => Array [custom_40] => Array [custom_22] => Array [custom_50] => Array [custom_50_other] => Array [custom_52_d] => Array [custom_52_m] => Array [custom_52_y] => Array [custom_52_note] => Array [custom_53] => Array [custom_13] => Array [custom_13_other] => Array [custom_1] => Array [custom_2_d] => Array [custom_2_m] => Array [custom_2_y] => Array [custom_3_d] => Array [custom_3_m] => Array [custom_3_y] => Array [custom_19] => Array [custom_31_d] => Array [custom_31_m] => Array [custom_31_y] => Array [custom_31_note] => Array [custom_32] => Array [custom_33] => Array [custom_16] => Array [custom_17] => Array [custom_18] => Array [custom_4] => Array [custom_5_d] => Array [custom_5_m] => Array [custom_5_y] => Array [custom_14] => Array [custom_23] => Array [custom_24] => Array [custom_24_other] => Array [custom_25] => Array [custom_29_d] => Array [custom_29_m] => Array [custom_29_y] => Array [custom_30_d] => Array [custom_30_m] => Array [custom_30_y] => Array [custom_27] => Array [custom_26] => Array [custom_28_d] => Array [custom_28_m] => Array [custom_28_y] => Array [custom_54_d] => Array [custom_54_m] => Array [custom_54_y] => Array [custom_54_note] => Array [custom_10] => Array [custom_11_d] => Array [custom_11_m] => Array [custom_11_y] => Array [custom_20_d] => Array [custom_20_m] => Array [custom_20_y] => Array [custom_21_d] => Array [custom_21_m] => Array [custom_21_y] => Array [custom_34] => Array [JethroSession] => xxx BACKTRACE:
[1] => Array
[2] => Array
[3] => Array
[4] => Array
[5] => Array
[6] => Array
) |
Looking at the backtrace, I really doubt it's related to re-defining the abstract_note view. Can you investigate and see if this is happening when you edit every person or just some people? I guess you could go back to the last upgrade sql file and get the old abstract_note view definition, but as I said I'm pretty confident this is unrelated. |
Thanks for looking into it. |
Yeah I've looked at it again and I'm really convinced that particular change can't have triggered this error. I've patched all my systems with this fix and havne't had this error. Maybe something else in your system changed (custom fields config?) in the meantime, and that's why your database rollback made the problem go away? |
Sorry to chew up your time chasing that. I just had an opportunity to look at it again. I rolled back to php 7.2 (from 7.4) and the error goes away. So it would appear to be something in the server's php settings which triggers the "trying to access array offset on value of type null" error. |
I have had a bit of time to try getting task reminders working again - because they are still not working even with crontab setup. I've run task_reminder.php with --verbose and the script appears to run, picks up whether task notifications are enabled or not etc. All good. But it returns an empty array for this: "$reminders = Abstract_Note::getNotifications($minutes);" So I booted into MYSQL and confirmed that the abstract_note view is defined.
All good. BUT if I select everything in that view... it returns and Empty set. So I took a look at how the abstract note is defined and I see this, which I think is OK. So, I don't know where to look now. |
Thought I'd have a closer look at the database. Select * from _abstract_note returns all the notes that are stored (whereas Select * from abstract_note returns nothing). MariaDB [jethro]> SHOW tables; |
Yes, _abstract_note is the actual table. abstract_note is a view, filtered according to which notes the current user should actually see. It refers to the @current_user_id variable, which Jethro sets when it runs. That's why you don't see anything if you go into MySQL directly. The task reminder script doesn't run "as" any particular user, which is what gave rise to the original issue #654 (comment) Can I suggest you re-run the SQL in #654 (comment) (which was in the 2.30 upgrade) to make sure it's applied. Then if you open mysql and run
you should see some results. |
Thanks. I realised (after my last comment) the difference b/w table/view. Silly of me. MariaDB [jethro]> select count() from abstract_note; So I'm back to the drawing-board with trouble-shooting task_reminder.php. If I modify task_reminder.php by adding two lines: $reminders = Abstract_Note::getNotifications($minutes); Then (through Jethro front end) add a note to a user or family. I can't help thinking there's something happening with mysql permissions? |
Embarrassing admission here - IT WAS NOT BROKEN - the task_reminder.php script does not send a reminder to new notes that you create for yourself I discovered this as I read through the code for the task_reminder.php That last line there. Oh well, I've learned my lesson now. |
Ah. Yes. It does that on the assumption that if you just assigned the note to yourself, you don't need a reminder! It'd be good if that bit of business logic was more clearly explained... any thoughts on where to put the explanation? |
The assumption is embarrassingly sensible - and I don't know why it didn't dawn on me when I was trying to test the reminder script. |
TODO: add a note to the "task notification subject" config setting |
Has anyone else got this issue? It used to work here, but appears to have stopped. If I assign a note which 'requires action' the Jethro user does not receive an email notification. I have a cron job set-up to run every 5 minutes ( */5 * * * * /usr/local/bin/php /home/churchxx/public_html/jethro/scripts/task_reminder.php ) and it used to work... not sure when it stopped? Roster reminders and email reports still send, so the system mail is still working. If I run /usr/local/bin/php /home/churchxx/public_html/jethro/scripts/task_reminder.php from the terminal I don't see any errors.
The text was updated successfully, but these errors were encountered: