Skip to content

fix: flat-file index and settings cache fixes for 4.1.1 - #625

Open
TallblokeUK wants to merge 3 commits into
corefrom
hotfix/flat-file-stale-index/core
Open

TallblokeUK wants to merge 3 commits into
corefrom
hotfix/flat-file-stale-index/core

Conversation

@TallblokeUK

Copy link
Copy Markdown
Contributor

Changes

  • When file-based execution is enabled, each flat-file index is rebuilt from the active snippets in the database instead of being merged into the existing index. The cached all-scopes snippet list is cleared before the rebuild. On multisite, network snippets are now read from the network table during the rebuild.
  • Flat-file index entries without a condition_id key load with no condition. This removes the Undefined array key "condition_id" warning on sites with an index written by an earlier version.
  • The settings cache is cleared after the settings option is added or updated, so saved values are read back correctly on sites with a persistent object cache. This replaces the earlier cache clear in the network settings save.
  • Added Handler_Registry::get_handlers().

Testing

  • New PHPUnit tests: Snippet_Files_Test (index rebuild, entry without condition_id) and Settings_Test (checkbox read back after save). All three fail on 4.1.0 and pass with these changes.
  • PHPUnit full suite: 504 tests, OK (43 skipped).
  • npm run lint:php: no findings.
  • Playwright chromium-file-based-snippets: 218 passed, 7 skipped.
  • Manual check on a local site with file-based execution: snippets deactivated or deleted while the setting was off do not run after it is switched back on.

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.

2 participants