Hello,
I am hoping you can help or point me into the right direction. We recently upgraded out DNN framework from v5.5.1 to V7.3.4. After the upgrade was complete, we noticed our Tab menu reordering was rearranged. We traced it down to the stored procedure of "DeleteTab".
In V5.5.1 we have the following code in proc "DeleteTab"
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
ALTER procedure [dbo].[DeleteTab]
@TabId int
as
delete from dbo.Tabs
where TabId = @TabId
In V7.3.4, we have the following code in proc "DeleteTab". We have traced it down to the update statement causing the reordering of our menu incorrectly.
My question is can you please help me understand why this code was introduced and/or if there is a fix for this?
If there is a fix, how do I update this stored procedure? Any information you can point me to or provide would be greatly appreciated.
/****** Object: StoredProcedure [dbo].[DeleteTab] Script Date: 05/15/2020 15:00:37 ******/
ALTER PROCEDURE [dbo].[DeleteTab]
@TabId Int -- ID of tab to delete; Not Null and > 0
AS
BEGIN
DECLARE @TabOrder Int
DECLARE @ParentId Int
DECLARE @ContentItemId Int
SELECT @TabOrder = TabOrder, @ParentId = ParentID, @ContentItemID = ContentItemID FROM dbo.[Tabs] WHERE TabID = @TabId
-- Delete Tab --
DELETE FROM dbo.[Tabs] WHERE TabID = @TabId
-- Update TabOrder of remaining Tabs --
UPDATE dbo.[Tabs]
SET TabOrder = TabOrder - 2
WHERE IsNull(ParentID, -1) = IsNull(@ParentId , -1) AND TabOrder > @TabOrder
-- Delete Content Item --
DELETE FROM dbo.[ContentItems] WHERE ContentItemID = @ContentItemId
END
Thanks!
ALTER PROCEDURE [dbo].[DeleteTab] @TabId INT -- ID of tab to delete; Not Null and > 0 AS BEGIN DECLARE @TabOrder INT DECLARE @ParentId INT DECLARE @ContentItemId INT DECLARE @PortalId INT SELECT @TabOrder = TabOrder, @ParentId = ParentID, @ContentItemID = ContentItemID, @PortalId = PortalID FROM dbo.[Tabs] WHERE TabID = @TabId -- Delete Tab -- DELETE FROM dbo.[Tabs] WHERE TabID = @TabId -- Update TabOrder of remaining Tabs -- UPDATE dbo.[Tabs] SET TabOrder = TabOrder - 2 WHERE ISNULL(ParentID, -1) = ISNULL(@ParentId , -1) AND TabOrder > @TabOrder AND (PortalID = @PortalId OR (PortalID IS NULL AND @PortalId IS NULL)) -- Delete Content Item -- DELETE FROM dbo.[ContentItems] WHERE ContentItemID = @ContentItemId END
These Forums are dedicated to the discussion of DNN Platform.
For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:
Awesome! Simply post in the forums using the link below and we'll get you started.