You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After installing the plugin, the notifications are created but not sent.
Indeed, by consulting the moodle database via the "mdl_notifications" table, I can see the creation of all the notifications, with the message chosen via the plugin.
However, this creation is not carried out in the "mdl_message_popup_notifications" table. It is the latter that allows their display.
By manually creating a new element using the INSERT TO command in the "mdl_message_popup_notifications" table, I was able to display a notification created via the external plugin and present in the "mdl_notifications" table.
In order to remedy this problem I added elements to the. "Local / resourcenotif / classes / notification.php" file by adding the code:
$ con = new PDO ('mysql: host = localhost; dbname = moodle', 'user', 'password');
$ command = $ con-> query ('SELECT MAX (id) FROM dl_notifications');
$ result = $ command-> fetch ();
$ write = "INSERT INTO `mdl_message_popup_notifications` (`notificationid`) VALUES ($ result [0])";
$ con-> query ($ write);
This code is added in the definition of the "public static function send_notification" function. I added the code after the if ($ res) { condition.
Thus, the right result is obtained.
For the database connection to work, I had to add use PDO; just after namespace local_resourcenotif;.
Do you have an other solution ?
Have you encounter this issue ?
Best regards.
The text was updated successfully, but these errors were encountered:
Hello.
Problematic moodle version 3.10.3+.
After installing the plugin, the notifications are created but not sent.
Indeed, by consulting the moodle database via the "mdl_notifications" table, I can see the creation of all the notifications, with the message chosen via the plugin.
However, this creation is not carried out in the "mdl_message_popup_notifications" table. It is the latter that allows their display.
By manually creating a new element using the INSERT TO command in the "mdl_message_popup_notifications" table, I was able to display a notification created via the external plugin and present in the "mdl_notifications" table.
In order to remedy this problem I added elements to the. "Local / resourcenotif / classes / notification.php" file by adding the code:
This code is added in the definition of the "public static function send_notification" function. I added the code after
the if ($ res) {
condition.Thus, the right result is obtained.
For the database connection to work, I had to add
use PDO;
just afternamespace local_resourcenotif;
.Do you have an other solution ?
Have you encounter this issue ?
Best regards.
The text was updated successfully, but these errors were encountered: