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

Global Search: results order selection does not display when no context

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide

      To test you will need to install a search plugin that supports more search ordering options than 'relevance' and 'location'. I have used search_elastic for this: https://github.com/catalyst/moodle-search_elastic

      To test:

      • Install a Moodle 3.5
      • Install a search plugin (like search_elastic) that supports multiple search result ordering options.
      • As a site administrator via the Moodle UI, enable global search and configure it to use the installed search plugin. (You do not need to index site data)
      • Navigate to '/search/index.php' in your Moodle UI

      Current behavior (before patch)

      The 'Results order' select dropdown will not be displayed

      Expected behavior (with patch applied)

      The 'Results order' select dropdown will be displayed showing the relevance and addition sort order options

      Show
      To test you will need to install a search plugin that supports more search ordering options than 'relevance' and 'location'. I have used search_elastic for this: https://github.com/catalyst/moodle-search_elastic To test: Install a Moodle 3.5 Install a search plugin (like search_elastic) that supports multiple search result ordering options. As a site administrator via the Moodle UI, enable global search and configure it to use the installed search plugin. (You do not need to index site data) Navigate to '/search/index.php' in your Moodle UI Current behavior (before patch) The 'Results order' select dropdown will not be displayed Expected behavior (with patch applied) The 'Results order' select dropdown will be displayed showing the relevance and addition sort order options
    • Affected Branches:
      MOODLE_35_STABLE
    • Fixed Branches:
      MOODLE_35_STABLE
    • Pull 3.5 Branch:
      MOODLE_35_STABLE_MDL-62705_results_order_no_context
    • Pull Master Branch:
      master_MDL-62705_results_order_no_context

      Description

      As of 3.5 a search plugin can define the result orders it supports. The built in Solr search plugin defines relevance and location, however, there can be others.

      The default result order is relevance.

      However, when a search plugin defines multiple sort orders such as modified date and the search is conducted without a context (no context query param in the URL), the code to load the available sort orders from the enabled search backend is never called.

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                9/Jul/18