Repository navigation
Keep template-defined user profile and search results pages on new portal creation - #7578
Open
idumlupinar wants to merge 1 commit into
Open
idumlupinar wants to merge 1 commit into
idumlupinar wants to merge 1 commit into
Conversation
Refactor UserTabId assignment logic for better clarity and fallback handling.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #7255
Summary
When a portal is created,
PortalTemplateImporter.ParseTabalready setsUserTabIdandSearchTabIdfrom the template's language-neutral<tabtype>usertab</tabtype>/<tabtype>searchtab</tabtype>markers and saves them viaUpdatePortalSetup. Right afterwards,PortalController.CreatePortalunconditionally overwrote both values withTabController.GetTabByTabPath(..., "//UserProfile" / "//ActivityFeed" / "//SearchResults"). Tab paths are built from tab names, so for a localized template (e.g. French, where the pages are named "Page profil utilisateur" / "Page de résultats de recherche") the lookup returns-1and clears the correct values. The new site's User Profile Page and Search Results Page then show as empty in Site Settings.This PR keeps the values set by the template and only falls back to the tab-path lookup when the template did not provide them (
-1). English templates resolve to the same Activity Feed / Search Results pages as before, and templates withouttabtypemarkers keep the old behaviour.Release Note
New sites created from a localized (non-English) site template now get their User Profile and Search Results pages set automatically.
Testing Steps
Portals\_default, copyDefault Website.template,Default Website.template.resourcesandDefault Website.template.en-US.resxtoRepro Website.*. In the.resx, changeTab.ActivityFeed.Name.TextandTab.SearchResults.Name.Textto non-English names (e.g.Flux activite,Resultats de recherche). Alternatively, install a French language pack and create a French site.Verified on clean installs of
develop(before) and this branch (after):No unit tests were added:
CreatePortalhas no existing test coverage and depends on staticTabControllerlookups and the template importer.