File tree Expand file tree Collapse file tree 3 files changed +13
-4
lines changed Expand file tree Collapse file tree 3 files changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -24,14 +24,18 @@ class SiteAccessChoiceLoader implements ChoiceLoaderInterface
2424
2525 private SiteAccessNameGeneratorInterface $ siteAccessNameGenerator ;
2626
27+ private ?string $ languageCode ;
28+
2729 public function __construct (
2830 SiteaccessResolverInterface $ nonAdminSiteaccessResolver ,
2931 SiteAccessNameGeneratorInterface $ siteAccessNameGenerator ,
30- ?Location $ location = null
32+ ?Location $ location = null ,
33+ ?string $ languageCode = null
3134 ) {
3235 $ this ->nonAdminSiteaccessResolver = $ nonAdminSiteaccessResolver ;
3336 $ this ->location = $ location ;
3437 $ this ->siteAccessNameGenerator = $ siteAccessNameGenerator ;
38+ $ this ->languageCode = $ languageCode ;
3539 }
3640
3741 /**
@@ -41,7 +45,11 @@ public function getChoiceList(): array
4145 {
4246 $ siteAccesses = $ this ->location === null
4347 ? $ this ->nonAdminSiteaccessResolver ->getSiteAccessesList ()
44- : $ this ->nonAdminSiteaccessResolver ->getSiteAccessesListForLocation (($ this ->location ));
48+ : $ this ->nonAdminSiteaccessResolver ->getSiteAccessesListForLocation (
49+ $ this ->location ,
50+ null ,
51+ $ this ->languageCode
52+ );
4553
4654 $ data = [];
4755 foreach ($ siteAccesses as $ siteAccess ) {
Original file line number Diff line number Diff 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 ,
Original file line number Diff line number Diff line change @@ -477,7 +477,7 @@ private function getContentPreviewItem(
477477 array $ options
478478 ): ItemInterface {
479479 $ versionNo = $ content ->getVersionInfo ()->versionNo ;
480- $ languageCode = $ content ->contentInfo -> mainLanguageCode ;
480+ $ languageCode = $ content ->getDefaultLanguageCode () ;
481481
482482 $ siteAccesses = $ this ->siteaccessResolver ->getSiteAccessesListForLocation (
483483 $ location ,
You can’t perform that action at this time.
0 commit comments