Skip to content

Commit 35a60ce

Browse files
Improve search indexing by removing deleted elements
1 parent c257386 commit 35a60ce

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

classes/search/elements.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,11 @@ public function check_access($id) {
207207

208208
try {
209209

210+
// Remove the deleted elements from the index.
211+
if (!$DB->record_exists('contentdesigner_options', ['id' => $id])) {
212+
return \core_search\manager::ACCESS_DELETED;
213+
}
214+
210215
$content = $DB->get_record('search_simpledb_index', ['itemid' => $id, 'areaid' => $this->areaid], '*', MUST_EXIST);
211216
$context = \context::instance_by_id($content->contextid);
212217
$cm = get_coursemodule_from_id('contentdesigner', $context->instanceid);

version.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
*/
2424

2525
defined('MOODLE_INTERNAL') || die();
26-
$plugin->version = 2025092301; // The current module version (Date: YYYYMMDDXX).
26+
$plugin->version = 2025092302; // The current module version (Date: YYYYMMDDXX).
2727
$plugin->requires = 2020061500; // Requires this Moodle version.
2828
$plugin->component = 'mod_contentdesigner'; // Full name of the plugin (used for diagnostics).
2929
$plugin->release = 'v1.6';

0 commit comments

Comments
 (0)