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

Global search: results are being double escaped

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.1
    • Fix Version/s: 3.1.2
    • Component/s: Global search
    • Labels:
    • Testing Instructions:
      Hide
      1. Configure your site with global search enabled, and at least forum posts and course information enabled
      2. Create a course titled "Escaped & Course"
      3. Create (or edit) as user with a last name "Escaped & User"
      4. As that user, create a forum post in the course, with the content "Escaped Forum Post"
      5. Run indexing with:

         php admin/tool/task/cli/schedule_task.php --execute="\\core\\task\\search_index_task" 

      6. Run a search for "Escaped"
      7. On the search page, confirm that the forum post shows this on the bottom line

         View this result in context - in course Escaped & Course - by XXXX Escaped & User 

      8. Inspect the page source and confirm that the & are really represented by

        &

        in the source.

      Confirm that all core_search and search_solr unit tests pass.

      Show
      Configure your site with global search enabled, and at least forum posts and course information enabled Create a course titled "Escaped & Course" Create (or edit) as user with a last name "Escaped & User" As that user, create a forum post in the course, with the content "Escaped Forum Post" Run indexing with: php admin/tool/task/cli/schedule_task.php --execute="\\core\\task\\search_index_task" Run a search for "Escaped" On the search page, confirm that the forum post shows this on the bottom line View this result in context - in course Escaped & Course - by XXXX Escaped & User Inspect the page source and confirm that the & are really represented by & in the source. Confirm that all core_search and search_solr unit tests pass.
    • Affected Branches:
      MOODLE_31_STABLE
    • Fixed Branches:
      MOODLE_31_STABLE
    • Pull 3.1 Branch:
    • Pull Master Branch:
      MDL-54926-master

      Description

      Global search double escapes course names and user's names in the 'context' line of results.

      To replicate this issue:

      1. Create a course called 'Teach & learn'. The ampersand here is required!
      2. Create a database activity within that course and remember the name of it.
      3. Enable global search and index all site contents.
      4. Search for the name of your database activity using the global search in the top right.
      5. On the results page, under your result, notice the View this result in context - in course Teach & a m p ; learn.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  12/Sep/16