Skip to content

Conversation

@DavRet
Copy link
Contributor

@DavRet DavRet commented Aug 13, 2025

Summary

When a parent page’s fe_group changes and extendToSubpages=1 is set, access rules effectively change for descendants as well. This PR ensures the index reflects those changes by triggering subtree reindexing and removing stale access variants.

What this PR does

  • Adds a changeSet wildcard ('*') in AbstractUpdateHandler to match “any change” of a field, because fe_group diffs are non-trivial.
  • Introduces trigger extendToSubpageEnabledAndFeGroupWasChanged in DataUpdateHandler and GarbageHandler:
    • If extendToSubpages=1 and fe_group changed → enqueue reindex for descendants (subtree) and clean up outdated access variants/documents.

How to test

  1. Create a small tree: parent P with extendToSubpages=1, children C1/C2 inheriting access (no local fe_group).
  2. Index once so all pages are present.
  3. Change P’s fe_group (e.g., add/remove a frontend group).
  4. Expected: subtree pages are queued for reindex; outdated access variants/documents are removed.
    (Before this PR: descendants did not reliably reindex; stale variants remained.)

Target versions

EXT:solr 13.x (current). Backportable if maintainers agree.

Related

Fixes: #4399

@dkd-kaehm
Copy link
Collaborator

@DavRet
Thanks for implementing that new feature we are missing.

@dkd-kaehm
Copy link
Collaborator

@DavRet
Thanks for implementing that feature.

Please fix the lint errors:

See: https://github.com/TYPO3-Solr/ext-solr/actions/runs/16937555290/job/48283985144?pr=4400#step:10:75

Loaded config TYPO3 from "/home/runner/work/ext-solr/ext-solr/.php-cs-fixer.php".
   1) Classes/Domain/Index/Queue/UpdateHandler/DataUpdateHandler.php (array_indentation)
      ---------- begin diff ----------
--- /home/runner/work/ext-solr/ext-solr/Classes/Domain/Index/Queue/UpdateHandler/DataUpdateHandler.php
+++ /home/runner/work/ext-solr/ext-solr/Classes/Domain/Index/Queue/UpdateHandler/DataUpdateHandler.php
@@ -92,7 +92,7 @@
         'no_search_sub_entriesFlagWasAdded' => [
             'changeSet' => ['no_search_sub_entries' => '0'],
         ],
-         // the current page has the field "extendToSubpages" enabled and the field "fe_group" was changed
+        // the current page has the field "extendToSubpages" enabled and the field "fe_group" was changed
         'extendToSubpageEnabledAndFeGroupWasChanged' => [
             'currentState' =>  ['extendToSubpages' => '1'],
             'changeSet' => ['fe_group' => '*'],

      ----------- end diff -----------

   2) Classes/Domain/Index/Queue/UpdateHandler/AbstractUpdateHandler.php (no_whitespace_in_blank_line)
      ---------- begin diff ----------
--- /home/runner/work/ext-solr/ext-solr/Classes/Domain/Index/Queue/UpdateHandler/AbstractUpdateHandler.php
+++ /home/runner/work/ext-solr/ext-solr/Classes/Domain/Index/Queue/UpdateHandler/AbstractUpdateHandler.php
@@ -268,7 +268,7 @@
                 return true;
             }
         }
-        
+
         $diff = array_diff_assoc($triggerConfiguration['changeSet'], $changedFields);
         return empty($diff);
     }

      ----------- end diff -----------

No functional changes; aligns with php-cs-fixer rules
(array_indentation, no_whitespace_in_blank_line).

Refs: TYPO3-Solr#4400
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.

[FEATURE] Cascade fe_group changes with extendToSubpages (reindex + cleanup)

2 participants