Skip to content

Fix PL link on Support v2 portal - #2845

Open
ruhisingh1 wants to merge 2 commits into
mainfrom
support-hotfix
Open

Fix PL link on Support v2 portal#2845
ruhisingh1 wants to merge 2 commits into
mainfrom
support-hotfix

Conversation

@ruhisingh1

@ruhisingh1 ruhisingh1 commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

Please provide the Jira Issue your PR is for.

Jira ID:

Test URLs:

AI Review Notes

@aem-code-sync

aem-code-sync Bot commented Aug 6, 2026

Copy link
Copy Markdown

Hello, I'm the AEM Code Sync Bot and I will run some actions to deploy your branch and validate page speed.
In case there are problems, just click a checkbox below to rerun the respective action.

  • Re-run all PSI checks
  • Re-run failed PSI checks
  • Re-sync branch
Commits

@ruhisingh1
ruhisingh1 marked this pull request as draft August 6, 2026 17:22
@ruhisingh1
ruhisingh1 marked this pull request as ready for review August 6, 2026 17:25
@aem-code-sync

aem-code-sync Bot commented Aug 6, 2026

Copy link
Copy Markdown
Page Scores Audits Google
📱 /?martech=off PERFORMANCE A11Y SEO BEST PRACTICES SI FCP LCP TBT CLS PSI
🖥️ /?martech=off PERFORMANCE A11Y SEO BEST PRACTICES SI FCP LCP TBT CLS PSI

Comment thread scripts/scripts.js
@claude

claude Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Reviewed the change in scripts/scripts.js that adds a /support/v2/ path check to fix the Premium Learning link locale mapping.

Finding (see inline comment): plSupportV2LangsMap (lines 808-819) is identical to plCommunityLangsMap (lines 795-806) — same keys/values, and both branches of the new lang IIFE use the same fallback (rawLang.split('-')[0]). Suggest reusing plCommunityLangsMap in both branches instead of maintaining two maps that must be kept in sync by hand.

Note: my inline suggestion only removes the duplicate map declaration — applying it alone would leave a dangling reference to plSupportV2LangsMap at line 840 (in the lang resolver) and break at runtime. The accompanying change (swap that reference to plCommunityLangsMap) needs to be made together with it.

No other correctness issues found — the fix logic itself (checking pathname before hostname, falling back to rawLang.split('-')[0]) looks correct for the Support v2 case.

@claude

claude Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Reviewed the updated diff on scripts/scripts.js.

  • The previously flagged duplicate-map issue (plSupportV2LangsMap vs plCommunityLangsMap) was addressed in review comments — the author confirmed it's intentional to allow the Support language set to diverge from Community's in the future. Not re-flagging.
  • Checked the new pathname-based branch (window.location.pathname.includes('/support/v2/')) for correctness: it's evaluated before the community-host check, uses the same rawLang.split('-')[0] fallback, and doesn't change behavior for non-support-v2 paths. No logic errors found.
  • Note (non-blocking, not filed inline since it's speculative): the resulting lang value from this IIFE also feeds unrelated URL builders further down in getConfig() (browseMoreProductsLink, eventsURL, automaticTranslationLink, premiumHomeUrl), not just the Premium Learning API calls. This mirrors the pre-existing behavior for the Community host branch, so it's likely intentional/consistent, but worth a quick sanity check that Support v2 pages expect two-letter lang codes in those other URLs too.

No new blocking issues found.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant