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

Commit be9058f

Browse files
donkerdavid-poindexter
authored andcommitted
Fix for upgrade issues of Personabar in 9.4.0 (#1170)
* Fix issues with upgrade of personabar to version 9.4.0 where old controllers were still in the DB and old packages were still registered * Update projects
1 parent 4fb61ed commit be9058f

File tree

4 files changed

+131
-0
lines changed

4 files changed

+131
-0
lines changed

Extensions/Content/Dnn.PersonaBar.Extensions/Dnn.PersonaBar.Extensions.csproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -714,6 +714,9 @@
714714
<ItemGroup>
715715
<Content Include="SqlDataProvider\03.00.00.SqlDataProvider" />
716716
</ItemGroup>
717+
<ItemGroup>
718+
<Content Include="SqlDataProvider\09.04.01.SqlDataProvider" />
719+
</ItemGroup>
717720
<Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != ''" />
718721
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" Condition="false" />
719722
<ProjectExtensions>
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/************************************************************/
2+
/***** SqlDataProvider *****/
3+
/***** *****/
4+
/***** *****/
5+
/***** Note: To manually execute this script you must *****/
6+
/***** perform a search and replace operation *****/
7+
/***** for {databaseOwner} and {objectQualifier} *****/
8+
/***** *****/
9+
/************************************************************/
10+
11+
/* Fix faulty 9.4.0 upgrades of the PersonaBar */
12+
13+
DELETE
14+
FROM {databaseOwner}{objectQualifier}Packages
15+
WHERE PackageType='PersonaBar'
16+
AND [Name] <> 'Dnn.PersonaBar.Extensions'
17+
AND Organization='DNN Corp.'
18+
GO
19+
20+
UPDATE {databaseOwner}{objectQualifier}PersonaBarMenu
21+
SET Controller = LEFT(Controller, CHARINDEX(',',Controller)-1) + ', Dnn.PersonaBar.Extensions'
22+
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')
23+
GO
24+

Library/Dnn.PersonaBar.UI/Dnn.PersonaBar.UI.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,7 @@
209209
<None Include="SqlDataProvider\01.01.00.SqlDataprovider" />
210210
<None Include="SqlDataProvider\01.03.00.SqlDataprovider" />
211211
<None Include="SqlDataProvider\01.04.00.SqlDataprovider" />
212+
<None Include="SqlDataProvider\09.04.01.SqlDataprovider" />
212213
<None Include="SqlDataProvider\01.05.00.SqlDataprovider" />
213214
<None Include="SqlDataProvider\Install.SqlDataprovider" />
214215
<None Include="SqlDataProvider\Uninstall.SqlDataProvider" />
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
/************************************************************/
2+
/***** SqlDataProvider *****/
3+
/***** *****/
4+
/***** *****/
5+
/***** Note: To manually execute this script you must *****/
6+
/***** perform a search and replace operation *****/
7+
/***** for {databaseOwner} and {objectQualifier} *****/
8+
/***** *****/
9+
/************************************************************/
10+
11+
/* Issue 1163: Fix update of Personabar where controller wasn't updated */
12+
13+
IF EXISTS (SELECT * FROM dbo.sysobjects where id = object_id(N'{databaseOwner}{objectQualifier}PersonaBar_SavePersonaBarMenu') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
14+
DROP PROCEDURE {databaseOwner}{objectQualifier}PersonaBar_SavePersonaBarMenu
15+
GO
16+
17+
CREATE PROCEDURE {databaseOwner}[{objectQualifier}PersonaBar_SavePersonaBarMenu]
18+
@Identifier NVARCHAR(50),
19+
@ModuleName NVARCHAR(50),
20+
@FolderName NVARCHAR(50),
21+
@Controller NVARCHAR(260),
22+
@ResourceKey NVARCHAR(50),
23+
@Path NVARCHAR(260),
24+
@Link NVARCHAR(260),
25+
@CssClass NVARCHAR(50),
26+
@ParentId INT,
27+
@Order INT,
28+
@AllowHost BIT,
29+
@Enabled BIT,
30+
@CurrentUserId INT,
31+
@IconFile NVARCHAR(260) = ''
32+
AS
33+
BEGIN
34+
IF EXISTS(SELECT Identifier FROM {databaseOwner}[{objectQualifier}PersonaBarMenu] WHERE Identifier = @Identifier)
35+
BEGIN
36+
UPDATE {databaseOwner}[{objectQualifier}PersonaBarMenu]
37+
SET
38+
ModuleName = @ModuleName,
39+
FolderName = @FolderName,
40+
Controller = @Controller,
41+
ResourceKey = @ResourceKey,
42+
Path = @Path,
43+
Link = @Link,
44+
CssClass = @CssClass,
45+
IconFile = @IconFile,
46+
ParentId = @ParentId,
47+
[Order] = @Order,
48+
AllowHost = @AllowHost,
49+
Enabled = @Enabled,
50+
LastModifiedByUserId = CASE WHEN @CurrentUserId = -1 THEN NULL ELSE @CurrentUserId END,
51+
LastModifiedOnDate = GETDATE()
52+
WHERE Identifier = @Identifier
53+
54+
SELECT MenuId FROM {databaseOwner}[{objectQualifier}PersonaBarMenu] WHERE Identifier = @Identifier
55+
END
56+
ELSE
57+
BEGIN
58+
INSERT INTO {databaseOwner}[{objectQualifier}PersonaBarMenu] (
59+
[Identifier],
60+
[ModuleName],
61+
[FolderName],
62+
[Controller],
63+
[ResourceKey],
64+
[Path],
65+
[Link],
66+
[CssClass],
67+
[IconFile],
68+
[ParentId],
69+
[Order],
70+
[AllowHost],
71+
[Enabled],
72+
[CreatedByUserId],
73+
[CreatedOnDate],
74+
[LastModifiedByUserId],
75+
[LastModifiedOnDate]
76+
) VALUES (
77+
@Identifier,
78+
@ModuleName,
79+
@FolderName,
80+
@Controller,
81+
@ResourceKey,
82+
@Path,
83+
@Link,
84+
@CssClass,
85+
@IconFile,
86+
@ParentId,
87+
@Order,
88+
@AllowHost,
89+
@Enabled,
90+
CASE WHEN @CurrentUserId = -1 THEN NULL ELSE @CurrentUserId END,
91+
GETDATE(),
92+
CASE WHEN @CurrentUserId = -1 THEN NULL ELSE @CurrentUserId END,
93+
GETDATE()
94+
)
95+
96+
SELECT SCOPE_IDENTITY()
97+
END
98+
END
99+
GO
100+
101+
/************************************************************/
102+
/***** SqlDataProvider *****/
103+
/************************************************************/

0 commit comments

Comments
 (0)