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 @@ -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 ) {
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 @@ -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 ,
You can’t perform that action at this time.
0 commit comments