Skip to content

[#157] Fix inverted hash comparison in filter_indexed_files causing full file reindex#158

Merged
dmitriim merged 2 commits into
catalyst:MOODLE_404_STABLEfrom
tsmilan:issue-157
May 13, 2026
Merged

[#157] Fix inverted hash comparison in filter_indexed_files causing full file reindex#158
dmitriim merged 2 commits into
catalyst:MOODLE_404_STABLEfrom
tsmilan:issue-157

Conversation

@tsmilan

@tsmilan tsmilan commented May 13, 2026

Copy link
Copy Markdown
Contributor

Summary

There was a one-character typo != instead of == in the filter_indexed_files() when comparing the content hash in the $unchanged boolean. This meant unchanged files evaluated to $unchanged = false and were queued for re-indexing on every incremental run, even when nothing had changed.

Testing Instructions

  1. Create a test course
  2. Create an assignment (or other module) and attach multiple files
  3. Navigate to Site administration > Server > Tasks > Scheduled task > Global search indexing (core\task\search_index_task)
    and run the indexer
  4. Verify that your file has been indexed successfully
  5. Update your assignment activity (e.g. title or description) and re-run the search_index_task
  6. Check the cron logs and verify that the file is being re-indexed again

Fixes #157

@dmitriim

Copy link
Copy Markdown
Member

@tsmilan can you please bump a version?

@tsmilan

tsmilan commented May 13, 2026

Copy link
Copy Markdown
Contributor Author

Thanks @dmitriim I've added a version bump

@dmitriim dmitriim merged commit 95247f4 into catalyst:MOODLE_404_STABLE May 13, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix inverted hash check

2 participants