Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-73747

Message provider "locked" setting may not be available on database

XMLWordPrintable

    • MOODLE_400_STABLE
    • MOODLE_400_STABLE
    • MDL-73747-master
    • Hide

      To fix the issue manually, you need to go to "Site administration > General > Messaging > Notification settings" (https://site/admin/message.php) and hit the "Save changes" button (without changing anything)

      Show
      To fix the issue manually, you need to go to "Site administration > General > Messaging > Notification settings" ( https://site/admin/message.php ) and hit the "Save changes" button (without changing anything)
    • Hide

      Prerequisites

      1. Test mail server (e.g. MailCatcher/MailHog)
      2. Outgoing email settings to copy after each install to config.php

        $CFG->smtphosts = 'localhost:1025'; // e.g. for MailCatcher.
        $CFG->noreplyaddress = 'noreply@example.com';
        

      Upgrading from a pre-regression site

      1. Create a new site based on 21 Jan 2022 on-demand release.
        1. git checkout e63604fb6da9a711852e0bb9593cd73783dc78c6
        2. Install the new site (e.g. mdk install -r users)
      2. Copy the outgoing email settings above to your config.php
      3. Check out the latest version
        • git checkout master
      4. Upgrade to the code of this patch.
      5. Confirm the upgrade process finishes with no errors. 
      6. Confirm an email with the subject 'Default MoodleNet setting changed' has been sent to the admin user's email account.

      Upgrading from a post-regression site

      1. Create a new site based on the 21 Jan 2022 on-demand release.
        1. git checkout e63604fb6da9a711852e0bb9593cd73783dc78c6
        2. Install the new site (e.g. mdk install -r users)
      2. Copy the outgoing email settings above to your config.php
      3. Check out the weekly release where the patch for MDL-67853 has been integrated
        • git checkout 4f9a539600cc6c5c1e9eb2d69e9fc55cc0e019de
      4. Upgrade the site
      5. Check out the latest version
        • git checkout master
      6. Upgrade to the code of this patch.
      7. Confirm the upgrade process finishes with no errors. 
      8. Confirm an email with the subject 'Default MoodleNet setting changed' has been sent to the admin user's email account.
      9. Create a new course and a new user and enrol the user as a student on the course.
      10. Go to Course > Announcements forum and 'Add discussion topic'.
      11. Fill requested Subject and Message fields and click on 'Advanced'.
      12. Select 'Send forum post notifications with no editing-time delay' and 'Post to forum'
      13. Run cron executing from terminal

        php admin/cli/cron.php

      14. Confirm the student had received an email with the post. 
      Show
      Prerequisites Test mail server (e.g. MailCatcher/MailHog) Outgoing email settings to copy after each install to config.php $CFG->smtphosts = 'localhost:1025'; // e.g. for MailCatcher. $CFG->noreplyaddress = 'noreply@example.com'; Upgrading from a pre-regression site Create a new site based on 21 Jan 2022 on-demand release. git checkout e63604fb6da9a711852e0bb9593cd73783dc78c6 Install the new site (e.g. mdk install -r users ) Copy the outgoing email settings above to your config.php Check out the latest version git checkout master Upgrade to the code of this patch. Confirm the upgrade process finishes with no errors.  Confirm an email with the subject 'Default MoodleNet setting changed' has been sent to the admin user's email account. Upgrading from a post-regression site Create a new site based on the 21 Jan 2022 on-demand release. git checkout e63604fb6da9a711852e0bb9593cd73783dc78c6 Install the new site (e.g. mdk install -r users ) Copy the outgoing email settings above to your config.php Check out the weekly release where the patch for MDL-67853 has been integrated git checkout 4f9a539600cc6c5c1e9eb2d69e9fc55cc0e019de Upgrade the site Check out the latest version git checkout master Upgrade to the code of this patch. Confirm the upgrade process finishes with no errors.  Confirm an email with the subject 'Default MoodleNet setting changed' has been sent to the admin user's email account. Create a new course and a new user and enrol the user as a student on the course. Go to Course > Announcements forum and 'Add discussion topic'. Fill requested Subject and Message fields and click on 'Advanced'. Select 'Send forum post notifications with no editing-time delay' and 'Post to forum' Run cron executing from terminal php admin/cli/cron.php Confirm the student had received an email with the post. 
    • Moppies Kanban

      This has been detected on MDL-73279.

      During the upgrade to remove loggedin/loggedoff pairs, the permitted setting was migrated to a new locked setting. But new locked setting was only saved on the database to reduce DB space. See code here.

      Also, message_send does not work if "locked" preference is not set on the DB (see code here. Same happens on send_message_to_conversation here.

      I found two possible solutions for that.

      1. Adding a new upgrade step where we check the enabled "%provider%_enabled" setting (it should always exist), and then add a locked setting "%provider%_locked" to 0 if it does not exist on the DB:
        SELECT * FROM mdl_config_plugins WHERE PLUGIN = 'message' AND name LIKE '%provider%_enabled'
      2. Change the behaviour of both functions to check for _enabled setting to exist on the DB instead of _locked (a new function to get enabled processor list would be a great benefit) for us and 3rd party.

       

      An easy way to reproduce the issue is to delete all rows on mdl_config_plugins where name is "%_locked" and plugin is 'message' and try to send a notification.

            amaia Amaia Anabitarte
            pferre22 Pau Ferrer
            Carlos Escobedo Carlos Escobedo
            Jun Pataleta Jun Pataleta
            Angelia Dela Cruz Angelia Dela Cruz
            Votes:
            5 Vote for this issue
            Watchers:
            21 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 day, 7 hours
                1d 7h

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.