Skip to content
This repository has been archived by the owner on Oct 6, 2019. It is now read-only.

Fix for upgrade issues of Personabar in 9.4.0 #1170

Merged
merged 2 commits into from
Sep 24, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -714,6 +714,9 @@
<ItemGroup>
<Content Include="SqlDataProvider\03.00.00.SqlDataProvider" />
</ItemGroup>
<ItemGroup>
<Content Include="SqlDataProvider\09.04.01.SqlDataProvider" />
</ItemGroup>
<Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != ''" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" Condition="false" />
<ProjectExtensions>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/************************************************************/
/***** SqlDataProvider *****/
/***** *****/
/***** *****/
/***** Note: To manually execute this script you must *****/
/***** perform a search and replace operation *****/
/***** for {databaseOwner} and {objectQualifier} *****/
/***** *****/
/************************************************************/

/* Fix faulty 9.4.0 upgrades of the PersonaBar */

DELETE
FROM {databaseOwner}{objectQualifier}Packages
WHERE PackageType='PersonaBar'
AND [Name] <> 'Dnn.PersonaBar.Extensions'
AND Organization='DNN Corp.'
GO

UPDATE {databaseOwner}{objectQualifier}PersonaBarMenu
SET Controller = LEFT(Controller, CHARINDEX(',',Controller)-1) + ', Dnn.PersonaBar.Extensions'
WHERE Identifier IN ('Dnn.AdminLogs','Dnn.ConfigConsole','Dnn.CssEditor','Dnn.Extensions','Dnn.Licensing','Dnn.Security','Dnn.Seo','Dnn.Servers','Dnn.Sites','Dnn.SiteSettings','Dnn.SqlConsole','Dnn.TaskScheduler','Dnn.Themes','Dnn.Users','Dnn.Pages','Dnn.SiteImportExport')
GO

1 change: 1 addition & 0 deletions Library/Dnn.PersonaBar.UI/Dnn.PersonaBar.UI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@
<None Include="SqlDataProvider\01.01.00.SqlDataprovider" />
<None Include="SqlDataProvider\01.03.00.SqlDataprovider" />
<None Include="SqlDataProvider\01.04.00.SqlDataprovider" />
<None Include="SqlDataProvider\09.04.01.SqlDataprovider" />
<None Include="SqlDataProvider\01.05.00.SqlDataprovider" />
<None Include="SqlDataProvider\Install.SqlDataprovider" />
<None Include="SqlDataProvider\Uninstall.SqlDataProvider" />
Expand Down
103 changes: 103 additions & 0 deletions Library/Dnn.PersonaBar.UI/SqlDataProvider/09.04.01.SqlDataprovider
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
/************************************************************/
/***** SqlDataProvider *****/
/***** *****/
/***** *****/
/***** Note: To manually execute this script you must *****/
/***** perform a search and replace operation *****/
/***** for {databaseOwner} and {objectQualifier} *****/
/***** *****/
/************************************************************/

/* Issue 1163: Fix update of Personabar where controller wasn't updated */

IF EXISTS (SELECT * FROM dbo.sysobjects where id = object_id(N'{databaseOwner}{objectQualifier}PersonaBar_SavePersonaBarMenu') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
DROP PROCEDURE {databaseOwner}{objectQualifier}PersonaBar_SavePersonaBarMenu
GO

CREATE PROCEDURE {databaseOwner}[{objectQualifier}PersonaBar_SavePersonaBarMenu]
@Identifier NVARCHAR(50),
@ModuleName NVARCHAR(50),
@FolderName NVARCHAR(50),
@Controller NVARCHAR(260),
@ResourceKey NVARCHAR(50),
@Path NVARCHAR(260),
@Link NVARCHAR(260),
@CssClass NVARCHAR(50),
@ParentId INT,
@Order INT,
@AllowHost BIT,
@Enabled BIT,
@CurrentUserId INT,
@IconFile NVARCHAR(260) = ''
AS
BEGIN
IF EXISTS(SELECT Identifier FROM {databaseOwner}[{objectQualifier}PersonaBarMenu] WHERE Identifier = @Identifier)
BEGIN
UPDATE {databaseOwner}[{objectQualifier}PersonaBarMenu]
SET
ModuleName = @ModuleName,
FolderName = @FolderName,
Controller = @Controller,
ResourceKey = @ResourceKey,
Path = @Path,
Link = @Link,
CssClass = @CssClass,
IconFile = @IconFile,
ParentId = @ParentId,
[Order] = @Order,
AllowHost = @AllowHost,
Enabled = @Enabled,
LastModifiedByUserId = CASE WHEN @CurrentUserId = -1 THEN NULL ELSE @CurrentUserId END,
LastModifiedOnDate = GETDATE()
WHERE Identifier = @Identifier

SELECT MenuId FROM {databaseOwner}[{objectQualifier}PersonaBarMenu] WHERE Identifier = @Identifier
END
ELSE
BEGIN
INSERT INTO {databaseOwner}[{objectQualifier}PersonaBarMenu] (
[Identifier],
[ModuleName],
[FolderName],
[Controller],
[ResourceKey],
[Path],
[Link],
[CssClass],
[IconFile],
[ParentId],
[Order],
[AllowHost],
[Enabled],
[CreatedByUserId],
[CreatedOnDate],
[LastModifiedByUserId],
[LastModifiedOnDate]
) VALUES (
@Identifier,
@ModuleName,
@FolderName,
@Controller,
@ResourceKey,
@Path,
@Link,
@CssClass,
@IconFile,
@ParentId,
@Order,
@AllowHost,
@Enabled,
CASE WHEN @CurrentUserId = -1 THEN NULL ELSE @CurrentUserId END,
GETDATE(),
CASE WHEN @CurrentUserId = -1 THEN NULL ELSE @CurrentUserId END,
GETDATE()
)

SELECT SCOPE_IDENTITY()
END
END
GO

/************************************************************/
/***** SqlDataProvider *****/
/************************************************************/