Commit 6d9914bd authored by Thomas Löffler's avatar Thomas Löffler
Browse files

[BUGFIX] Use correct PageRepository for generating breadcrumb

parent 459d787d
Pipeline #25628 passed with stages
in 6 minutes and 3 seconds
......@@ -15,7 +15,11 @@ namespace T3o\T3orgLayout\ViewHelpers\Solr;
* The TYPO3 project - inspiring people to share!
*/
class RootlineViewHelper extends \TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper
use TYPO3\CMS\Core\Domain\Repository\PageRepository;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
class RootlineViewHelper extends AbstractViewHelper
{
use \TYPO3Fluid\Fluid\Core\ViewHelper\Traits\CompileWithRenderStatic;
......@@ -56,13 +60,12 @@ class RootlineViewHelper extends \TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewH
public function getRootline(array $pidsRootline): array
{
$rootline = [];
$pageRepository = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Extbase\Object\ObjectManager::class)
->get(\TYPO3\CMS\Frontend\Page\PageRepository::class);
$pageRepository = GeneralUtility::makeInstance(PageRepository::class);
// Get more information and check if page should appear
foreach ($pidsRootline as $pid) {
$page = $pageRepository->getPage((int)$pid);
if ((int)$page['hidden'] === 0 && \TYPO3\CMS\Core\Utility\GeneralUtility::inList($this->doktypeList, $page['doktype'])) {
if ((int)$page['hidden'] === 0 && GeneralUtility::inList($this->doktypeList, $page['doktype'])) {
$rootline[] = $page;
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment