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

Broken link in insights notification

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.4
    • Fix Version/s: 3.4.3
    • Component/s: Analytics
    • Labels:
    • Testing Instructions:
      Hide
      Prerequisites
      1. Outgoing email server. Alternatively, you can use Mailcatcher:
        1. Open your terminal
        2. Install Mailcatcher: gem install mailcatcher
        3. Run mailcatcher: mailcatcher
        4. Open your browser and go to http://localhost:1080
        5. Edit your moodle instance's config.php and add the following line:

          $CFG->smtphosts = 'localhost:1025';
          

      2. A manager user assigned at system level
      3. A course without teachers that starts in 2 days
      Test
      1. Start mailcatcher (mailcatcher command in command line interface) and open http://localhost:1080/ in a browser tab
      2. Go to "Site admin > Analytics > Analytics settings" and disable "Analytics processes execution via command line only" setting
      3. Log in as the manager user
      4. Go to your preferences menu and follow "Notification preferences" link. You should find "Insights generated by prediction models" listed there. Enable all notifications.
      5. Go to "Site admin > Analytics > Analytics models"
      6. Execute "No teaching" model's "Actions > Get predictions" (If "Get predictions" option is not available just select "Actions > Clear predictions". It should appear after that)
      7. Check the mailcatcher browser tab, you should have an incoming message, select it and press "Download" (the button on the bottom right side)
      8. Open the downloaded .eml file and search for "The system generated some insights for you", it should appear twice, one for the text version of the email (Content-Type: text/plain; charset=UTF-8) and one for the html version (Content-Type: text/html; charset=UTF-8) the one below
        1. The text version link should not contain ;&amp just the & characted
        2. The html version link href attribute should contain ;&amp
      Show
      Prerequisites Outgoing email server. Alternatively, you can use Mailcatcher: Open your terminal Install Mailcatcher: gem install mailcatcher Run mailcatcher: mailcatcher Open your browser and go to http://localhost:1080 Edit your moodle instance's config.php and add the following line: $CFG->smtphosts = 'localhost:1025'; A manager user assigned at system level A course without teachers that starts in 2 days Test Start mailcatcher (mailcatcher command in command line interface) and open http://localhost:1080/ in a browser tab Go to "Site admin > Analytics > Analytics settings" and disable "Analytics processes execution via command line only" setting Log in as the manager user Go to your preferences menu and follow "Notification preferences" link. You should find "Insights generated by prediction models" listed there. Enable all notifications. Go to "Site admin > Analytics > Analytics models" Execute "No teaching" model's "Actions > Get predictions" (If "Get predictions" option is not available just select "Actions > Clear predictions". It should appear after that) Check the mailcatcher browser tab, you should have an incoming message, select it and press "Download" (the button on the bottom right side) Open the downloaded .eml file and search for "The system generated some insights for you", it should appear twice, one for the text version of the email (Content-Type: text/plain; charset=UTF-8) and one for the html version (Content-Type: text/html; charset=UTF-8) the one below The text version link should not contain ;&amp just the & characted The html version link href attribute should contain ;&amp
    • Affected Branches:
      MOODLE_34_STABLE
    • Fixed Branches:
      MOODLE_34_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-61154_master

      Description

      The e-mail with new generated insights received by a teacher contains link to report

      https://domian/report/insights/insights.php?modelid=1&contextid=69683

      The problem is with the "&amp"

      When a user clicks on this link he receives A required parameter (contextid) was missing.

      I think that the problem may be in analytics/classes/local/target/base.php:209

      $message->fullmessageformat = FORMAT_PLAIN;

       

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                2 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  17/May/18

                  Time Tracking

                  Estimated:
                  Original Estimate - 0 minutes
                  0m
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 4 hours
                  4h