news
news copied to clipboard
TCA treeConfig.rootUid is broken by news' DatabaseTreeDataProvider
Bug Report
Current Behavior
In TCA, I can conveniently reduce the category tree with this piece of TSConfig:
TCEFORM.tx_news_domain_model_news.categories.config.treeConfig.rootUid = 26
It works well, but if category uid=26
is a category mount, the category tree shows only the category uid=26
and no children categories.
\GeorgRinger\News\TreeProvider\DatabaseTreeDataProvider
overrides buildRepresentationForNode and something seems to be missing.
Expected behavior/output
I expect that treeConfig.rootUid
behaves correctly in every scenarii when \GeorgRinger\News\TreeProvider\DatabaseTreeDataProvider
is involved.
Environment
- TYPO3 version: 8.7
- news version: 6.3.0, 7.3.1
- Is your TYPO3 installation set up with Composer (Composer Mode): yes
- OS: debian 9
Possible Solution
Check the overrided code in \GeorgRinger\News\TreeProvider\DatabaseTreeDataProvider
Also, found this closed issue on forge: https://forge.typo3.org/issues/71461
In the override of buildRepresentationForNode
, there is a call to isCategoryAllowed
. This is the one which is responsible of the children of treeConfig.rootUid
not being shown.
In theory, \TYPO3\CMS\Backend\Security\CategoryPermissionsAspect
should check before buildRepresentationForNode
the tree data for the access rights on categories. So, IMHO there is no need to check again for access rights with isCategoryAllowed
.
Updated patch for news 8.3 : news_category_tree.patch.txt
The tree provider is disabled in 8.3.0, see c40ea4e84f6c90837f58c510c5513a2d449cefc3