Project

General

Profile

Actions

Bug #94670

open

Redirects module: RecordLinkHandler can't resolve storagePid if value is site configuration variable

Added by Benjamin Gries Gries over 2 years ago. Updated 9 months ago.

Status:
Accepted
Priority:
Should have
Assignee:
-
Category:
Link Handling, Site Handling & Routing
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
10
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

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


Related issues 1 (0 open1 closed)

Follows (465 days) TYPO3 Core - Feature #91081: Populate site settings to TSconfigClosedBenni Mack2020-04-17

Actions
Actions #1

Updated by Benjamin Gries Gries over 2 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
Actions #2

Updated by Benjamin Gries Gries over 2 years ago

  • Description updated (diff)
  • Start date deleted (2022-01-31)
Actions #3

Updated by Oliver Hader over 1 year 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!

Actions #4

Updated by Oliver Hader over 1 year ago

  • Sprint Focus set to On Location Sprint
Actions #5

Updated by Benjamin Gries Gries over 1 year 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
        }
        ...
    }
}
Actions #6

Updated by Oliver Hader over 1 year ago

  • Status changed from Needs Feedback to Accepted

Updated by Benjamin Gries Gries over 1 year ago

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.

Actions #8

Updated by Benni Mack 9 months ago

  • Sprint Focus deleted (On Location Sprint)
Actions

Also available in: Atom PDF