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

Restored contexts waiting to be indexed may be already deleted

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.4, 3.5
    • Fix Version/s: 3.4.3
    • Component/s: Global search
    • Labels:
    • Testing Instructions:
      Hide
      Setup
      1. Log in as admin
      2. Enable and set up Global search
      3. Create a new course for testing
      4. Back up the course
      5. Restore the backup to a new course
      6. Restore the same backup to a second new course
      7. Delete the second restored copy of the course (easiest way to do this: change the course/view.php in the URL to course/delete.php)
      Test
      1. Go to the scheduled tasks screen (Site administration -> Server -> Scheduled tasks)
      2. Click Run now against the Global search indexing scheduled task
        • EXPECTED: Among other output, you should see a line referring to the copy that you didn't delete, such as Completed requested context: Course: My test course copy 1 (0.2s), and a line referring to the copy that you did delete, such as Skipped deleted context: 251
      3. Run the task again
        • EXPECTED: The task should basically do nothing (a bunch of 'No new documents to index), and specifically it shouldn't show the Skipped text again, indicating that the deleted context has been removed from the queue

      Before this bug was fixed, an exception was thrown instead of the 'Skipped' line.

      Show
      Setup Log in as admin Enable and set up Global search Create a new course for testing Back up the course Restore the backup to a new course Restore the same backup to a second new course Delete the second restored copy of the course (easiest way to do this: change the course/view.php in the URL to course/delete.php ) Test Go to the scheduled tasks screen ( Site administration -> Server -> Scheduled tasks ) Click Run now against the Global search indexing scheduled task EXPECTED: Among other output, you should see a line referring to the copy that you didn't delete, such as Completed requested context: Course: My test course copy 1 (0.2s) , and a line referring to the copy that you did delete, such as Skipped deleted context: 251 Run the task again EXPECTED: The task should basically do nothing (a bunch of 'No new documents to index), and specifically it shouldn't show the Skipped text again, indicating that the deleted context has been removed from the queue Before this bug was fixed, an exception was thrown instead of the 'Skipped' line.
    • Affected Branches:
      MOODLE_34_STABLE, MOODLE_35_STABLE
    • Fixed Branches:
      MOODLE_34_STABLE
    • Pull Master Branch:
      MDL-61824-master

      Description

      $context = \context::instance_by_id($request->contextid); in core_search\manager::process_index_requests requires the context to exist and the context may already be deleted, we should skip unexisting records. e.g. an IGNORE_MISSING + continue;

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                quen Sam Marshall
                Reporter:
                dmonllao David Monllaó
                Peer reviewer:
                David Monllaó
                Integrator:
                Eloy Lafuente (stronk7)
                Tester:
                Marina Glancy
                Participants:
                Component watchers:
                Amaia Anabitarte, Bas Brands, Carlos Escobedo, Sara Arjona (@sarjona), Víctor Déniz Falcón
              • Votes:
                1 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

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