• Login
  • Register

DNN Forums

A community discussion page. We're starting from scratch, so...let's get the party started!

DeleteTab Stored Procedure

You are not authorized to post a reply.
Sort:


New Member


Posts:1
New Member

    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

    GO

    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 ******/

    SET ANSI_NULLS ON

    GO

    SET QUOTED_IDENTIFIER ON

    GO

    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!

    You are not authorized to post a reply.

    These Forums are dedicated to discussion of DNN Platform.

    For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

    1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
    2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
    3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
    4. No Flaming or Trolling.
    5. No Profanity, Racism, or Prejudice.
    6. Site Moderators have the final word on approving / removing a thread or post or comment.
    7. English language posting only, please.

    Would you like to help us?

    Awesome! Simply post in the forums using the link below and we'll get you started.

    Get Involved