Skip to content

Commit

Permalink
Merge branch '2.2' into 2.3
Browse files Browse the repository at this point in the history
  • Loading branch information
mateuszbieniek committed May 27, 2021
2 parents 6d9a1aa + 8e0b365 commit ba27dc0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/lib/UI/Module/ContentTree/NodeFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
*/
final class NodeFactory
{
private const TOP_NODE_CONTENT_ID = 0;
private const SORT_CLAUSE_MAP = [
'DatePublished' => SortClause\DatePublished::class,
'ContentName' => SortClause\ContentName::class,
Expand Down Expand Up @@ -301,7 +302,10 @@ private function buildNode(
*/
private function supplyTranslatedContentName(Node $node, array $contentById): void
{
$node->name = $this->translationHelper->getTranslatedContentName($contentById[$node->contentId]);
if ($node->contentId !== self::TOP_NODE_CONTENT_ID) {
$node->name = $this->translationHelper->getTranslatedContentName($contentById[$node->contentId]);
}

foreach ($node->children as $child) {
$this->supplyTranslatedContentName($child, $contentById);
}
Expand Down

0 comments on commit ba27dc0

Please sign in to comment.