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

Course request email contains unformatted/incorrect information

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • 5.1
    • Course
    • MOODLE_501_STABLE
    • Hide

      Setup

      1. Login as admin
      2. Navigate to Plugins > Filters > Manage filters in site administration
      3. Set Mutli-language content to "On" and "Apply to: Content and headings"
      4. Navigate to Courses > Course request in site administration
      5. Set Course request notification to "Admin User"
      6. Create a new user
      7. Navigate to Users > Permissions > Define roles in site administration
      8. Edit Authenticated user role
      9. Allow the moodle/course:request capability, and save
      10. Logout

      Request course

      1. Login as new user
      2. Manually navigate to <WWWROOT>/course/request.php
        • Course full name:

          <span class="multilang" lang="en">English</span><span class="multilang" lang="es">Spanish</span>
          

        • Course short name:

          <span class="multilang" lang="en">ENG</span><span class="multilang" lang="es">SPA</span>
          

        • Course category: Category 1
        • Reason: My new course
        • Press Request a course

      View email

      1. Confirm you've received an email with the following content:

        Course full name: English
        Course short name: ENG
        Category: Category 1
        Reason for this course request: My new course
        

      Show
      Setup Login as admin Navigate to Plugins > Filters > Manage filters in site administration Set Mutli-language content to "On" and "Apply to: Content and headings" Navigate to Courses > Course request in site administration Set Course request notification to "Admin User" Create a new user Navigate to Users > Permissions > Define roles in site administration Edit Authenticated user role Allow the moodle/course:request capability, and save Logout Request course Login as new user Manually navigate to <WWWROOT>/course/request.php Course full name: <span class="multilang" lang="en">English</span><span class="multilang" lang="es">Spanish</span> Course short name: <span class="multilang" lang="en">ENG</span><span class="multilang" lang="es">SPA</span> Course category: Category 1 Reason: My new course Press Request a course View email Confirm you've received an email with the following content: Course full name: English Course short name: ENG Category: Category 1 Reason for this course request: My new course
    • Hide

      Code verified against automated checks.

      Checked MDL-85346 using repository: https://github.com/paulholden/moodle/

      More information about this report

      Built on: Mon May 5 21:16:28 UTC 2025

      Show
      Code verified against automated checks. Checked MDL-85346 using repository: https://github.com/paulholden/moodle/ main (0 errors / 0 warnings) [branch: MDL-85346 | CI Job ] More information about this report Built on: Mon May 5 21:16:28 UTC 2025
    • Show
      Launching automatic jobs for branch MDL-85346 https://ci.moodle.org/view/Testing/job/DEV.02%20-%20Developer-requested%20PHPUnit/19195/ PHPUnit (sqlsrv) https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/65600/ Behat (NonJS - boost and classic) https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/65601/ Behat (Firefox - boost) https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/65602/ Behat (Firefox - classic) https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/65603/ App tests (stable app version) Built on: Mon May 5 10:30:17 UTC 2025

      We should tidy up the data that is being sent in response to course requests, that originated in MDL-85003

      From https://github.com/moodle/moodle/commit/d8ce093322a261190e5d45a2c63e5e7112c5036d

      • Course shortname and fullname are unformatted
      • Course category is returning the numeric category ID, instead of the name (it's clear from the earlier screenshots in MDL-85003 what was intended, but this was never implemented or tested)
      • All the fields are null coalesced, which doesn't make sense when calling methods that return string

      This is what an admin receives for a multilanguage filtered site:

      This is how the same data is presented in the pending requests table:

      Fix the email so it matches that admin UI

            pholden Paul Holden
            pholden Paul Holden
            Amaia Anabitarte Amaia Anabitarte
            Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 28 minutes
                28m

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