Moodle Messages problem after upgrading to 3.9

Moodle Messages problem after upgrading to 3.9

by Florian Bachofner-Mayr -
Number of replies: 6

Dear community,

we've upgraded our Moodle installation from 3.8 to 3.9 last night. Everything worked fine at the first sight (although the process of upgrading needed an experienced system administrator...), but we're experiencing massive problems with the built in messaging system as well with mobile push notifications since the upgrade:

  • When sending a message via browser I get the following error message as a popup:
    "Cannot read property 'lastmessagedate' of undefined"
  • Additionally I get the following error message as a second popup:
    Syntax error, unrecognized expression: (with the whole text of the message following)
  • Also, I get the following error message in my message stream:
    Error: Call to a member function force_process_messages() on null

We've figured out that messages are sent and also received, but the errors make the built in messenger tool not useable any more. Additionally, no push notifications are sent to any user (although we have an active premium plan).

You can find some screenshots attached. We hope for quick replies – thx in advance!

Attachment Screenshot-moodle.png
Average of ratings: -
In reply to Florian Bachofner-Mayr

Re: Moodle Messages problem after upgrading to 3.9

by Matthew Marinovich -
We have the same problem occurring on Moodle 3.8.3+

Any suggestions on how to diagnose / fix this would be appreciated!
In reply to Matthew Marinovich

Re: Moodle Messages problem after upgrading to 3.9

by Paul Hale -
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