Bug #94670
openRedirects module: RecordLinkHandler can't resolve storagePid if value is site configuration variable
0%
Description
We found out that the Redirects module can't handle it if a site configuration variable (so for example storagePid = {$pids.news}) is used for the storagePids in the linkHandler instead of a hardcoded UID (so for example storagePid = 5).
The main problem is that in the context of the redirects module the getPagesTSconfig function of the BackendUtility has PID 0 (because the redirects are on PID 0), therefore no (default) page configuration is found and accordingly the parsing of the TSConfig cannot take place correctly.
The corresponding variable in the RecordLinkHandler ($this->expandPage) falls back to pid 0 (because the redirects are on PID 0, see above), which is adverse for non-admin users because they are not allowed to access the page. The non-admin user cannot use the LinkHandler accordingly.
Files
Updated by Benjamin Gries Gries about 3 years ago
- Due date set to 2022-01-31
- Start date changed from 2021-07-30 to 2022-01-31
- Follows Feature #91081: Populate site settings to TSconfig added
Updated by Benjamin Gries Gries about 3 years ago
- Description updated (diff)
- Start date deleted (
2022-01-31)
Updated by Oliver Hader almost 2 years ago
- Due date deleted (
2022-01-31) - Status changed from New to Needs Feedback
Can you please add example how redirects look like and how they were configured? Thanks in advance!
Updated by Oliver Hader almost 2 years ago
- Sprint Focus set to On Location Sprint
Updated by Benjamin Gries Gries almost 2 years ago
Hi Oliver,
sure.
Site configuration:
base: / rootPageId: 1 ... settings: pids: ... news: 5 ...
TSConfig:
TCEMAIN { linkHandler { tx_project_articles { handler = TYPO3\CMS\Recordlist\LinkHandler\RecordLinkHandler label = Article configuration { table = tx_project_domain_model_article storagePid = {$pids.news} hidePageTree = 1 } scanAfter = page } ... } }
Updated by Oliver Hader almost 2 years ago
- Status changed from Needs Feedback to Accepted
Updated by Benjamin Gries Gries almost 2 years ago
- File linkhandler-hardcoded-uid-hide-page-tree.png linkhandler-hardcoded-uid-hide-page-tree.png added
- File linkhandler-site-settings-hide-page-tree.png linkhandler-site-settings-hide-page-tree.png added
- File linkhandler-site-settings-show-page-tree.png linkhandler-site-settings-show-page-tree.png added
Articles couldn't be accessed if the page tree is hidden:
I could 'solve' this by enabling the page tree in linkhandler or searching for articles with 'Infinite levels'
However, it does work with hidden page tree if storagePid is set with an hardcoded uid (e.g. storagePid = 5
)
I think this is a very special case. Before creating the ticket, I had discussed with Benni Mack in slack whether a default site configuration can be defined for such cases, which then takes effect. However, such a solution may not be necessary at all.
Updated by Benni Mack about 1 year ago
- Sprint Focus deleted (
On Location Sprint)