[FEATURE] Add nonglobal tag scoping via TYPO3 feature flag#8
Merged
Conversation
…he current object space Feature for #69964
Introduce the pagebased.nonglobalTags feature flag (off by default). When enabled, TagUtility::getTags() auto-detects the current blog category from the rootline and scopes tag queries to that category. Returns null if no registered category page is found, preventing a global tag dump. Skips detection when category is already set on demand. The findTagStrings/collectTagsFromStrings optimisation path is preserved and active regardless of flag state. Also fixes a bug from the feature branch: the rootline lookup now uses RegistrationService::getRegistrationByCategoryDocumentType() instead of a hardcoded doktype value. Enable per installation in AdditionalConfiguration.php: $GLOBALS['TYPO3_CONF_VARS']['SYS']['features']['pagebased.nonglobalTags'] = true;
Contributor
There was a problem hiding this comment.
Pull request overview
Adds opt-in (feature-flagged) non-global tag scoping so TagUtility::getTags() can restrict tag results to the category found in the current page’s rootline, while preserving the existing global behavior by default.
Changes:
- Register new TYPO3 feature flag
pagebased.nonglobalTags(defaultfalse). - Update
TagUtility::getTags()to conditionally auto-scope demands to a rootline category (or returnnullwhen none is found). - Add functional tests + CSV fixtures covering flag on/off scenarios and rootline resolution cases.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
ext_localconf.php |
Introduces the feature flag configuration default (false). |
Classes/Utility/TagUtility.php |
Guards rootline/category auto-detection behind the feature flag and scopes/short-circuits tag results accordingly. |
Tests/Functional/Utility/TagUtilityTest.php |
Adds functional coverage for all described flag behaviors (global vs scoped vs null). |
Tests/Functional/Fixtures/Database/pages_tags.csv |
Adds fixture data with two categories and tagged objects to validate scoping behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Scope rootline category lookup to the repository's own registration doktype to avoid cross-registration matches in multi-registration installations; falls back to any registered doktype when registration cannot be resolved. - Rename $blogCategoryUid to $categoryUid and remove 'blog' wording from inline comments – TagUtility is generic, not blog-specific. - Add comment in tearDown() explaining why setAccessible(true) is intentionally absent (no-op / deprecated since PHP 8.1).
srosskopf
approved these changes
Mar 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Integrates the
feature/nonglobal-tagschanges intomasterbehind a TYPO3 system feature flag, making the behaviour opt-in per installation.Feature flag
Also available via the Install Tool → Admin Tools → Features.
Behaviour
TagUtility::getTags()behaviournull— no tag dumpChanges
ext_localconf.php— registers the feature flag (default:false)Classes/Utility/TagUtility.php— wraps rootline detection in the flag guard; also fixes a bug from the feature branch where the category doktype was hardcoded as93instead of usingRegistrationService::getRegistrationByCategoryDocumentType()Tests/Functional/Utility/TagUtilityTest.php— 4 functional tests covering all flag statesTests/Functional/Fixtures/Database/pages_tags.csv— fixture with two categories and tagged objects