Skip to content

Keep template-defined user profile and search results pages on new portal creation - #7578

Open
idumlupinar wants to merge 1 commit into
dnnsoftware:developfrom
idumlupinar:bugfix-7255
Open

idumlupinar wants to merge 1 commit into
dnnsoftware:developfrom
idumlupinar:bugfix-7255

Conversation

@idumlupinar

Copy link
Copy Markdown
Contributor

Fixes #7255

Summary

When a portal is created, PortalTemplateImporter.ParseTab already sets UserTabId and SearchTabId from the template's language-neutral <tabtype>usertab</tabtype> / <tabtype>searchtab</tabtype> markers and saves them via UpdatePortalSetup. Right afterwards, PortalController.CreatePortal unconditionally overwrote both values with TabController.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 -1 and 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 without tabtype markers 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

  1. In Portals\_default, copy Default Website.template, Default Website.template.resources and Default Website.template.en-US.resx to Repro Website.*. In the .resx, change Tab.ActivityFeed.Name.Text and Tab.SearchResults.Name.Text to non-English names (e.g. Flux activite, Resultats de recherche). Alternatively, install a French language pack and create a French site.
  2. Persona Bar → Sites → Add New Site, using the "Repro Website" template.
  3. Open the new site's Site Settings → Site Behavior → Default Pages.
    • Before: User Profile Page and Search Results Page are empty.
    • After: they point to the renamed pages.
  4. Regression check: create a site from the standard Default Website template. The pages are still Activity Feed and Search Results.

Verified on clean installs of develop (before) and this branch (after):

Template Before After
Renamed (localized) pages UserTabId -1, SearchTabId -1 Flux activite / Resultats de recherche
Default Website Activity Feed / Search Results Activity Feed / Search Results

No unit tests were added: CreatePortal has no existing test coverage and depends on static TabController lookups and the template importer.

Refactor UserTabId assignment logic for better clarity and fallback handling.

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: User profile page and Search result page not initalisated on new non english portal

1 participant