adobe / adobe/aem-core-wcm-components
Language Navigation in Live Copy using incorrect root page
- Dominant language
- Java
- Stars
- 796
- Forks
- 776
- Avg merge
- 3d 22h
- Merged PRs (30d)
- 8
Description
When a `Language Navigation` component is in a template structure, or in a blueprint XF inherited to a live copy site, the `Navigation Root` isn't updated to the Live Copy site, and thus the nav links/languages point to the blueprint site rather than the live copy.
Language Navigation should operate similar to the `Navigation` component, which takes the configured Navigation Root page and updates it to the current site path before calculating nav links.
The update would be made to `LanguageNavigationImpl`, using similar logic as `NavigationImpl`, changing:
```
public List getItems() {
if (items == null) {
PageManager pageManager = currentPage.getPageManager();
rootPage = pageManager.getPage(navigationRoot);
if (rootPage != null) {
```
to
```
public List getItems() {
if (items == null) {
PageManager pageManager = currentPage.getPageManager();
rootPage = pageManager.getPage(navigationRoot);
rootPage = LocalizationUtils.getLocalPage(rootPage,
this.currentPage,
this.request.getResourceResolver(),
this.languageManager,
this.relationshipManager)
.orElseGet(() -> rootPage);
if (rootPage != null) {
```
Contributor guide
Research direction
Start at LanguageNavigationImpl.getItems() and compare its navigation-root handling with NavigationImpl. Verify the behavior for a Language Navigation component in a template or blueprint-inherited live copy; done means its language links point to the live copy site rather than the blueprint site.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- localization
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 52/100