Category tree - #32
Draft
maikschneider wants to merge 25 commits into
Draft
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
# Conflicts: # .ddev/commands/web/init-typo3 # Configuration/Backend/AjaxRoutes.php
# Conflicts: # phpstan-baseline.neon
The TSconfig assignment in initializeConfiguration() was commented out while the variable was still read for hideRecords and showNavTitle, emitting an 'Undefined variable' warning on every tree data fetch. The two resulting PHPStan errors were suppressed in the baseline instead of fixed. Restore the assignment and drop the baseline entries.
ASCII strtolower() left titles with German umlauts (ä/ö/ü) unmatched when searching the category tree. Use mb_strtolower() so the case-fold covers multibyte characters.
pagesToFlatArray() was a verbatim copy of the core page-tree method, never called by the category tree. Drop it along with the properties it exclusively used (addIdAsPrefix, addDomainName, showMountPathAboveMounts, backgroundColors, labels, expandAllNodes, useNavTitle), the now-unused imports (Label, BackendUtility, Permission), the commented-out config blocks in initializeConfiguration(), and the stale PHPStan baseline entry for the always-true ternary that no longer exists.
getIconForRecord() returns a non-nullable Icon, so the ?-> on it was flagged by PHPStan (nullsafe.neverNull). Resolve the icon once into a local, use a plain -> for getIdentifier(), and keep the nullsafe only on getOverlayIcon() which is genuinely nullable. Also removes the unused $identifier local. CategoryTreeController is now PHPStan-clean.
fetchDataAction() always fetched the full root tree, then threw it away and re-queried when a parent was requested. Move the root fetch into the else branch that actually consumes it, so a lazy child-load runs one query instead of two.
Category nodes were emitted with the DTO defaults (editable=false,
deletable=false) regardless of the backend user's rights. Resolve both
flags from BackendUserAuthentication::check('tables_modify',
'sys_category') (admins always pass), cached per request and applied in
categoryToFlatArray so both the data and filter actions are covered.
DataHandler still enforces record-level access on the actual write.
Expose a canModify flag in the tree configuration (from the same tables_modify check used for node flags) and only render the toolbar drag-to-create type items when it is true. Users without sys_category modify rights no longer see a create affordance that DataHandler would reject anyway. Rebuilds the bundled JS.
# Conflicts: # phpstan-baseline.neon
# Conflicts: # Configuration/Backend/AjaxRoutes.php
# Conflicts: # phpstan-baseline.neon
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.
No description provided.