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

core_search: Require confirmation for search areas screen actions

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.5
    • Fix Version/s: 3.5
    • Component/s: Global search
    • Labels:
    • Testing Instructions:
      Hide
      1. You need a Moodle site that is set up to work with Moodle global search using Apache Solr, Simple Search or another search engine. (to be enabled @ admin -> plugins -> search. It will make this test quicker if your site does not have much content. (I.e. if it only takes a couple of minutes to index everything.)
      2. Go to the search areas page in the site administration menu (Plugins / Search / Search areas)
      3. Click Update indexed contents.
        • EXPECTED: A confirmation prompt should appear.
      4. Click Cancel
        • EXPECTED: You get back to the search areas page.
      5. Click Update indexed contents and, this time, Continue.
        • EXPECTED: The search index should be updated (this may be slow if you have added a a lot of content since it was last updated, and there is no indication of any progress). You should get back to the search areas page with a Search engine contents have been updated notification message.
      6. Click Delete all site contents.
        • EXPECTED: You should see a confirm prompt.
      7. Click Continue.
        • EXPECTED: After a short time you should be returned to the search areas page with a notification All indexed contents have been deleted. Each search area should show Never for its last indexed time.
      8. Click Reindex all site contents.
        • EXPECTED: You should see a confirm prompt.
      9. Click Continue.
        • EXPECTED: The search index will be recreated (this will be slow if your site contains significant content; on my test site it takes about 15 minutes, during which there is no indication of any progress). You should get back to the search areas page with a notification All site contents have been reindexed. The search areas should now show last-update dates again.
      10. Next to one of the search areas that contains content, click Delete index.
        • EXPECTED: You should see a confirm prompt.
      11. Click Continue.
        • EXPECTED: After a short time you should be returned to the search areas page with a notification Index deleted. That search area should be marked as Never updated.
      12. Click the Disable (eye) link next to a search area.
        • EXPECTED: You should get back to the search areas page and the area should be marked as disabled, with a notification Search area disabled. The URL should be the plain searchareas.php and should not include other parameters such as action=disable.
      13. Click the Enable (eye) link next to the disabled area.
        • EXPECTED: You should get back to the search areas page and the area should be marked as enabled, with a notification Search area enabled. The URL should be the plain searchareas.php and should not include other parameters such as action=enable.
      Show
      You need a Moodle site that is set up to work with Moodle global search using Apache Solr, Simple Search or another search engine. (to be enabled @ admin -> plugins -> search. It will make this test quicker if your site does not have much content. (I.e. if it only takes a couple of minutes to index everything.) Go to the search areas page in the site administration menu ( Plugins / Search / Search areas ) Click Update indexed contents . EXPECTED: A confirmation prompt should appear. Click Cancel EXPECTED: You get back to the search areas page. Click Update indexed contents and, this time, Continue . EXPECTED: The search index should be updated (this may be slow if you have added a a lot of content since it was last updated, and there is no indication of any progress). You should get back to the search areas page with a Search engine contents have been updated notification message. Click Delete all site contents . EXPECTED: You should see a confirm prompt. Click Continue . EXPECTED: After a short time you should be returned to the search areas page with a notification All indexed contents have been deleted . Each search area should show Never for its last indexed time. Click Reindex all site contents . EXPECTED: You should see a confirm prompt. Click Continue . EXPECTED: The search index will be recreated (this will be slow if your site contains significant content; on my test site it takes about 15 minutes, during which there is no indication of any progress). You should get back to the search areas page with a notification All site contents have been reindexed . The search areas should now show last-update dates again. Next to one of the search areas that contains content, click Delete index . EXPECTED: You should see a confirm prompt. Click Continue . EXPECTED: After a short time you should be returned to the search areas page with a notification Index deleted . That search area should be marked as Never updated. Click the Disable (eye) link next to a search area. EXPECTED: You should get back to the search areas page and the area should be marked as disabled, with a notification Search area disabled . The URL should be the plain searchareas.php and should not include other parameters such as action=disable. Click the Enable (eye) link next to the disabled area. EXPECTED: You should get back to the search areas page and the area should be marked as enabled, with a notification Search area enabled . The URL should be the plain searchareas.php and should not include other parameters such as action=enable.
    • Affected Branches:
      MOODLE_35_STABLE
    • Fixed Branches:
      MOODLE_35_STABLE
    • Pull Master Branch:
      MDL-61076-master

      Description

      The search areas screen contains the following action buttons:

      • Update indexed contents
      • Reindex all site contents
      • Delete all indexed contents
      • Delete index (against each search area)

      These options are relatively benign on test sites, but for sites with a substantial search index, all these buttons are potentially risky or damaging:

      • Update indexed contents - if pressed when index has not yet been created, might take an unreasonably long time and likely time out in the web browser.
      • Reindex all site contents - will take an unreasonably long time and time out in the web browser.
      • Delete all indexed contents - will immediately break search for all users until such time as the index can be rebuilt.
      • Delete index - will immediately break search within that search area for all users until such time as the index can be rebuilt.

      For example, on my employer's main system, if somebody hits 'delete all indexed contents' it will take approximately a month before search works properly again. This would probably not be considered acceptable by students.

      All these options are available only to administrators but administrators can press buttons by accident too! I propose adding a confirmation screen for each option.

      Additionally there is one other problem with this screen even when used for testing - after taking some of these actions, it remains in the URL. If, like I did, you delete a search area and then some time later reload the page (intending just to see how far indexing has got in that search area) you may find yourself deleting the search area again! A confirmation screen (which then redirects back to the normal view after carrying out the action) would also solve this problem.

        Attachments

        1. 1.PNG
          1.PNG
          162 kB
        2. 2.PNG
          2.PNG
          141 kB

          Activity

            People

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

              Dates

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