Incorrect tab order on new portals
Description
When creating a new portal from a template the new pages are created with a taborder that continues from the max(taborder) from the DB.
This is incorrect, since each portal needs to start it's taborder from 1.
The error is on the SP AddTabToEnd since it does not filter tabs by portalid when calculating the new taborder:
SET @TabOrder = (SELECT MAX(TabOrder) FROM dbo.Tabs WHERE (ParentId = @ParentId OR (ParentId IS NULL AND @ParentID IS NULL)))
Should be:
SET @TabOrder = (SELECT MAX(TabOrder) FROM dbo.Tabs WHERE Portalid = @PortalID AND
(ParentId = @ParentId OR (ParentId IS NULL AND @ParentID IS NULL)))
QA Test Plan
Activity
Now it is good.
TabOrder always starts from "1" by Portal.
Please be aware of there is a bug noticed: DNN-5899, about portal creation, not sure if they are related.
Noticed a potential performance issue during portal creation:
When create a new template, purposely check off all pages with TabOrder = 1.
The generation of the portal takes longer time.
taborder should start at 1 for each parent page, not portal
See latest comment from Vicenc
TabId will NEVER start at 1 for new portals. This is the PK of the table. The fix was for reseting the TabOrder to 1 on new portals.
Before taborder started at MAX+1 for all portals, which was not correct. Taborder should start at 1 for all new portals.
Not fixed in 7.3.3 build 95
Test Case..
in latest 7.3.3 build log in as Host
Go Host > Site Management
Create a Parent or Child portal
Using SMSS connect to the database of the site
click "New Query" button
Use <database name here>
Select * from dbo.Tabs where PortalID=0
Open a 2nd new query window
Use <database name here>
Select * from dbo.Tabs where PortalID=<new parent/child portal ID>
Actual Result:
In Platform the tab id's of the new parent/child portal are in numerical ordering of Portal 0 (zero)
In Content they don't numerically follow Portal 0 (zero) but they aren't starting from 1 (one) either
Expected Result:
Any parent/child portal tab id's would start from 1 (one)
SCREEN CAST: http://screencast.com/t/0HZqqBcyHBg