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

Restored contexts waiting to be indexed may be already deleted

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • 3.4.3
    • 3.4, 3.5
    • Global search
    • MOODLE_34_STABLE, MOODLE_35_STABLE
    • MOODLE_34_STABLE
    • MDL-61824-master
    • 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.

      $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;

            quen Sam Marshall
            dmonllao David Monllaó
            David Monllaó David Monllaó
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            Marina Glancy Marina Glancy
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.