From 2b2b22f26f6dfae46d15b6f7c5b92f6643e82265 Mon Sep 17 00:00:00 2001 From: Bartek Wajda Date: Thu, 5 Dec 2024 14:58:40 +0100 Subject: [PATCH] IBX-9289: Remove dependency on Content --- src/lib/UI/Module/ContentTree/NodeFactory.php | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/src/lib/UI/Module/ContentTree/NodeFactory.php b/src/lib/UI/Module/ContentTree/NodeFactory.php index ee283a097d..1c00d55c29 100644 --- a/src/lib/UI/Module/ContentTree/NodeFactory.php +++ b/src/lib/UI/Module/ContentTree/NodeFactory.php @@ -356,9 +356,6 @@ private function buildNode( $containerLocations[] = $location; } - $content = $location->getContent(); - $versionInfo = $content->getVersionInfo(); - $limit = $this->resolveLoadLimit($loadSubtreeRequestNode); $offset = null !== $loadSubtreeRequestNode ? $loadSubtreeRequestNode->offset @@ -391,17 +388,11 @@ private function buildNode( } } - //TODO tylko tego nie mamy - //$translations = $versionInfo->getLanguageCodes(); - - //TODO to mozemy z lokacji - $mainLanguageCode = $location->getContentInfo()->getMainLanguageCode(); - return new Node( $depth, $location->getId(), $location->getContentId(), - $versionInfo->getVersionNo(), + $contentInfo->currentVersionNo, '', // node name will be provided later by `supplyTranslatedContentName` method null !== $contentType ? $contentType->getIdentifier() : '', null === $contentType || $contentType->isContainer(), @@ -410,7 +401,7 @@ private function buildNode( $totalChildrenCount, $this->getReverseRelationsCount($contentInfo), isset($bookmarkLocations[$location->getId()]), - $mainLanguageCode, + $contentInfo->getMainLanguageCode(), $children, $location->getPathString() );