Hello everyone, I hope you are well.
Recently, a problem started occurring with the messaging sidebar in Moodle. Below, I describe the problem and provide the error that appears in the console along with the line where the error originates.
Clarifications:
Last week, the company that provides the server to my workplace updated the PHP version, which caused problems with TTL, preventing access to the platform. It is assumed that this issue has been resolved.
I should also clarify that at no point this year have I updated Moodle's configuration or modified any file on the server.
The theme I use in Moodle is Move, which we have not updated at any time, nor have we updated any other plugin installed on the platform.
The company providing the server says it is a problem with our Moodle, not their issue.
Problem Description:
The problem is that when clicking on the chat bubble to open messaging, the sidebar that should unfold on the right does not appear, and the error is resolved by refreshing the page with Ctrl+F5.
It is also worth mentioning that this error does not always occur; sometimes it works perfectly on the first try from certain devices.
The messaging service works perfectly. If I go directly to the page "myDomain/message/index.php", I can send messages without any issues.
Error printed in the console:
Uncaught TypeError: Cannot read properties of null (reading 'attr')
at first.js:1878:2423
at show (first.js:1878:2444)
at String.changeRoute (first.js:2037:1181)
at Object.go (first.js:2037:1864)
at show (first.js:1894:3054)
at first.js:1894:5436
at first.js:734:684
at Array.forEach (<anonymous>)
at _exports.publish (first.js:734:656)
at HTMLAnchorElement.<anonymous> (first.js:1957:725)
Line where the error originates:
var fromPanel = header.attr("data-in-panel") ? "frompanel" : null;
getSearchInput(header).val("");
var loggedInUserId = function(body) {
return body.attr("data-user-id") -Line 1878 where the error originates-
}(body)
, allCounts = function(loggedInUserId) {
return null === loadAllCountsPromise && (loadAllCountsPromise = MessageRepository.getAllConversationCounts(loggedInUserId)),
loadAllCountsPromise
}(loggedInUserId)
Attempts to Resolve:
Based on my research, it might be related to the PHP update error and/or the cache. I purged all Moodle caches, but the problem persists, and I cleared all data from my browsers, but that didn't work either.
If anyone has encountered this error or could guide me on how to resolve it, I would greatly appreciate it.