Skip to content

Commit 983fb73

Browse files
committed
Merge branch '4.6'
# Conflicts: # src/lib/Form/Type/ChoiceList/Loader/SiteAccessChoiceLoader.php
2 parents b9575cf + 2e799a7 commit 983fb73

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

src/lib/Form/Type/ChoiceList/Loader/SiteAccessChoiceLoader.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,18 @@ class SiteAccessChoiceLoader implements ChoiceLoaderInterface
2323

2424
private SiteAccessNameGeneratorInterface $siteAccessNameGenerator;
2525

26+
private ?string $languageCode;
27+
2628
public function __construct(
2729
SiteaccessResolverInterface $nonAdminSiteAccessResolver,
2830
SiteAccessNameGeneratorInterface $siteAccessNameGenerator,
29-
?Location $location = null
31+
?Location $location = null,
32+
?string $languageCode = null
3033
) {
3134
$this->nonAdminSiteAccessResolver = $nonAdminSiteAccessResolver;
3235
$this->location = $location;
3336
$this->siteAccessNameGenerator = $siteAccessNameGenerator;
37+
$this->languageCode = $languageCode;
3438
}
3539

3640
/**
@@ -40,7 +44,11 @@ public function getChoiceList(): array
4044
{
4145
$siteAccesses = $this->location === null
4246
? $this->nonAdminSiteAccessResolver->getSiteAccessesList()
43-
: $this->nonAdminSiteAccessResolver->getSiteAccessesListForLocation(($this->location));
47+
: $this->nonAdminSiteAccessResolver->getSiteAccessesListForLocation(
48+
$this->location,
49+
null,
50+
$this->languageCode,
51+
);
4452

4553
$data = [];
4654
foreach ($siteAccesses as $siteAccess) {

src/lib/Form/Type/Preview/SiteAccessChoiceType.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ public function configureOptions(OptionsResolver $resolver): void
5151
new SiteAccessChoiceLoader(
5252
$this->siteAccessResolver,
5353
$this->siteAccessNameGenerator,
54-
$options['location']
54+
$options['location'],
55+
$options['languageCode'],
5556
),
5657
$this->urlGenerator,
5758
$options['content']->id,

src/lib/Menu/ContentRightSidebarBuilder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,7 @@ private function getContentPreviewItem(
476476
array $options
477477
): ItemInterface {
478478
$versionNo = $content->getVersionInfo()->versionNo;
479-
$languageCode = $content->contentInfo->mainLanguageCode;
479+
$languageCode = $content->getDefaultLanguageCode();
480480

481481
$siteAccesses = $this->siteaccessResolver->getSiteAccessesListForLocation(
482482
$location,

0 commit comments

Comments
 (0)