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

Global search: results are being double escaped

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 3.1
    • 3.1.2
    • Global search
    • MOODLE_31_STABLE
    • MOODLE_31_STABLE
    • MDL-54926-master
    • 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.

    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

              emerrill Eric Merrill
              jaked Jake Dallimore
              David Monllaó David Monllaó
              Dan Poltawski Dan Poltawski
              Jun Pataleta Jun Pataleta
              David Woloszyn, Huong Nguyen, Jake Dallimore, Meirza, Michael Hawkins, Raquel Ortega, Safat Shahin, Stevani Andolo
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                12/Sep/16