Moodle Messages problem after upgrading to 3.9

Re: Moodle Messages problem after upgrading to 3.9

by Paul Hale -
Number of replies: 4
I am also facing the same issue with the messaging.
I looked in the error log and found the following but not sure what it means:
[14-Jan-2021 18:20:57 Europe/London] Default exception handler: Exception - Call to a member function load_data() on null Debug: 
Error code: generalexceptionmessage
* line 1502 of /message/classes/api.php: Error thrown
* line 230 of /message/renderer.php: call to core_message\api::get_all_message_preferences()
* line 75 of /message/notificationpreferences.php: call to core_message_renderer->render_user_notification_preferences()

My messages are being send and delivered but each one has a warning as shown below:



In reply to Paul Hale

Re: Moodle Messages problem after upgrading to 3.9

by Marian Dent -
Dear Paul, Did you ever get your Moodle messaging error fixed, and if so are you willing to pass on the solution. Because we just upgraded and are getting the same error and can't figure out how to fix it. Thanks in advance, Marian
In reply to Marian Dent

Re: Moodle Messages problem after upgrading to 3.9

by Paul Hale -

I am still experiencing the same problem.i have narrowed it down to the Snap theme. If I change theme to Boost the messaging works fine. Just finished experimenting with the latest Sanp release, I will let you know how that works.

In reply to Paul Hale

Re: Moodle Messages problem after upgrading to 3.9

by Marian Dent -
Thanks Paul, That's odd because we ARE using the Boost theme. But maybe switching themes will help. I'll let you know if we figure anything out too. Marian
In reply to Marian Dent

Re: Moodle Messages problem after upgrading to 3.9

by Paul Hale -
I have managed to correct the error 😊

To start I enabled debugging in the config.php file by adding the following lines at the end of the file:

ini_set ('display_errors', 'on');
ini_set ('log_errors', 'on');
ini_set ('display_startup_errors', 'on');
ini_set ('error_reporting', E_ALL);
$CFG->debug = 30719; // DEBUG_ALL, but that constant is not defined here.

When I went to the message and tried to send a new error appeared:

"unexpected token < in JSON at position 0

Chasing this error lead me to an error in line 135 of /lib/classes/message/manager.php

Line 135 $processors = array_filter(get_message_processors(false), function($processor) {

I am no programmer and as I could not see any obvious error I tried changing the vale of Line 135 to (True) now my messaging works without errors.

I hope this proves helpful, my next issue is I cant add contacts in the message area, but that is for another day.

Regards
Paul