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

Forum digest emails contain incorrect links and duplicated information

XMLWordPrintable

    • MOODLE_30_STABLE
    • MOODLE_30_STABLE
    • MDL-52137-master
    • Hide
      1. Create a course + forum (optional mode)
      2. As a second user, subscribe to the forum and change your digest preference to Digest full
      3. As first user post two items in the forum, ticking the "Mail now" box
      4. Make the following change to mod/forum/lib.php:

        diff --git a/mod/forum/lib.php b/mod/forum/lib.php
        index 29f4f6d..5c83469 100644
        --- a/mod/forum/lib.php
        +++ b/mod/forum/lib.php
        @@ -902,6 +902,8 @@ function forum_cron() {
             $weekago = $timenow - (7 * 24 * 3600);
             $DB->delete_records_select('forum_queue', "timemodified < ?", array($weekago));
             mtrace ('Cleaned old digest records');
        +    $digesttime = $timenow - 1;
        +    $CFG->digestmailtimelast = $weekago - 1;
         
             if ($CFG->digestmailtimelast < $digesttime and $timenow > $digesttime) {
        

      5. Run the forum scheduled task:

        php admin/tool/task/cli/schedule_task.php --execute="\mod_forum\task\cron_task"
        

      6. Check your e-mail
        1. Confirm that you do not have duplicated header/footer links for each email
      Show
      Create a course + forum (optional mode) As a second user, subscribe to the forum and change your digest preference to Digest full As first user post two items in the forum, ticking the "Mail now" box Make the following change to mod/forum/lib.php: diff --git a/mod/forum/lib.php b/mod/forum/lib.php index 29f4f6d..5c83469 100644 --- a/mod/forum/lib.php +++ b/mod/forum/lib.php @@ -902,6 +902,8 @@ function forum_cron() { $weekago = $timenow - (7 * 24 * 3600); $DB->delete_records_select('forum_queue', "timemodified < ?", array($weekago)); mtrace ('Cleaned old digest records'); + $digesttime = $timenow - 1; + $CFG->digestmailtimelast = $weekago - 1;   if ($CFG->digestmailtimelast < $digesttime and $timenow > $digesttime) { Run the forum scheduled task: php admin/tool/task/cli/schedule_task.php --execute="\mod_forum\task\cron_task" Check your e-mail Confirm that you do not have duplicated header/footer links for each email

      While testing MDL-52126, playing with digest mails, a bunch of errors where found:

      1) The links to edit the digest preferences are wrong (more than once). They point to 2 incorrect urls.
      2) Both the text and html full digests have information duplicated. It seems that some parts were not deleted from forum_cron() and they are printed both there and later again in the template.

      Adding screenshots...

      Worth verifying also the simple digest mails, they may exhibit similar problems.

        1. html_full_digest.png
          html_full_digest.png
          78 kB
        2. IMG_5706.PNG
          IMG_5706.PNG
          165 kB
        3. IMG_5707.PNG
          IMG_5707.PNG
          134 kB
        4. Screen Shot 2015-11-30 at 6.30.21 AM.png
          Screen Shot 2015-11-30 at 6.30.21 AM.png
          22 kB
        5. Screen Shot 2015-11-30 at 6.30.30 AM.png
          Screen Shot 2015-11-30 at 6.30.30 AM.png
          20 kB
        6. Screen Shot 2015-11-30 at 6.30.40 AM.png
          Screen Shot 2015-11-30 at 6.30.40 AM.png
          15 kB
        7. text_full_digest.png
          text_full_digest.png
          128 kB

            dobedobedoh Andrew Lyons
            stronk7 Eloy Lafuente (stronk7)
            David Monllaó David Monllaó
            Rajesh Taneja Rajesh Taneja
            Votes:
            3 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved:

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