vhs icon indicating copy to clipboard operation
vhs copied to clipboard

content.render slide -1 content_from_pid

Open prdt3e opened this issue 5 years ago • 7 comments
trafficstars

Typo3: 10.2 VHS: 6

I have a globe that has content_from_pid Home-Site. However, it shows the content of the globe with slide = "- 1". The error is probably caused by content_from_pid. I remove slide = "- 1" it works with content_from_pid but no inheritance anymore.

prdt3e avatar Apr 21 '20 09:04 prdt3e

So I analyzed that. The error stems from getRootLine (Service/PageService.php). It appears that getRootLine has been removed from pageRepository: #85557.

$rootline = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Utility\RootlineUtility::class, $pageUid)->get();

RootlineUtility is backward compatible. What do you think?

@josefglatz

prdt3e avatar Apr 24 '20 22:04 prdt3e

RootlineUtility is backward compatible.

Including on TYPO3 8.7?

NamelessCoder avatar Apr 25 '20 09:04 NamelessCoder

Yes: https://github.com/TYPO3/TYPO3.CMS/blob/TYPO3_8-7/typo3/sysext/core/Classes/Utility/RootlineUtility.php

prdt3e avatar Apr 25 '20 10:04 prdt3e

suggestion

use TYPO3\CMS\Core\Utility\RootlineUtility;

if (false === isset(static::$cachedRootlines[$cacheKey])) {
    $rootline = GeneralUtility::makeInstance(RootlineUtility::class, $pageUid);
    try {
        $rootline = $rootline->get();
    } catch (\RuntimeException $ex) {
        if (isset($GLOBALS['TSFE'])) {
            $rootline = (array) $GLOBALS['TSFE']->rootLine;
        } else {
            $rootline = [];
        }
    }
    if (true === $reverse) {
        $rootline = array_reverse($rootline);
    }
    static::$cachedRootlines[$cacheKey] = $rootline;
}

Now the disableGroupAccessCheck is still missing. But I think this has had no effect for a long time, because in 9.5 the pagerepository only instanced RootlineUtility.

prdt3e avatar Apr 25 '20 10:04 prdt3e

https://github.com/TYPO3/TYPO3.CMS/blob/9.5/typo3/sysext/frontend/Classes/Page/PageRepository.php (1214)

https://github.com/TYPO3/TYPO3.CMS/blob/TYPO3_8-7/typo3/sysext/frontend/Classes/Page/PageRepository.php (950)

prdt3e avatar Apr 25 '20 10:04 prdt3e

Does nobody have the problem with v10?

prdt3e avatar Jul 14 '20 23:07 prdt3e

Does nobody have the problem with v10?

Sorry, I don't use that feature anymore from vhs anymore. I'm using my own TypoScript since I don't want to rely too much on 3rd party extensions - even if it feels more productive

josefglatz avatar Jul 15 '20 02:07 josefglatz