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

Handling for deleted activities

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 3.1
    • Fix Version/s: 3.1
    • Component/s: Global search
    • Labels:
    • Testing Instructions:
      Hide

      Would be better if you don't use an specially big site to test this.

      1. Setup global search and solr https://docs.moodle.org/dev/Global_search
      2. Index your site's data
      3. Search for something as an admin, and open one of the results in a new tab
      4. Delete whatever the result is (if it is a page, delete the page activity, if it is a forum post, delete the discussion...)
      5. Refresh the search results page or perform another search with the same search query
      6. You should not see any fatal error and results should be listed without including the deleted result
      Show
      Would be better if you don't use an specially big site to test this. Setup global search and solr https://docs.moodle.org/dev/Global_search Index your site's data Search for something as an admin, and open one of the results in a new tab Delete whatever the result is (if it is a page, delete the page activity, if it is a forum post, delete the discussion...) Refresh the search results page or perform another search with the same search query You should not see any fatal error and results should be listed without including the deleted result
    • Affected Branches:
      MOODLE_31_STABLE
    • Fixed Branches:
      MOODLE_31_STABLE
    • Epic Link:
    • Pull from Repository:
    • Pull Master Branch:
      MDL-53272_master

      Description

      Right now, if you delete an activity that has been index, delete it, then enter a search that would return it, you will get a fatal DB error:

      Debug info: SELECT * FROM {context} WHERE id = ?
      [array (
      0 => 47,
      )]
      Error code: invalidrecord
       
      Stack trace:
      line 1461 of /lib/dml/moodle_database.php: dml_missing_record_exception thrown
      line 1437 of /lib/dml/moodle_database.php: call to moodle_database->get_record_select()
      line 5449 of /lib/accesslib.php: call to moodle_database->get_record()
      line 1401 of /lib/weblib.php: call to context::instance_by_id()
      line 447 of /search/classes/document.php: call to format_string()
      line 84 of /search/classes/output/renderer.php: call to core_search\document->export_for_template()
      line 67 of /search/classes/output/renderer.php: call to core_search\output\renderer->render_result()
      line 106 of /search/index.php: call to core_search\output\renderer->render_results()
      

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                23/May/16