Skip to content

Commit e490a73

Browse files
committed
Added a bit of case insensitivity
1 parent 90224ed commit e490a73

File tree

3 files changed

+28
-11
lines changed

3 files changed

+28
-11
lines changed

Umbraco.RelationEditor/Configuration.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ public RelationEditorConfiguration()
4646

4747
public class ObjectTypeConfiguration : EntityConfiguration
4848
{
49+
private const StringComparison IgnoreCase = StringComparison.InvariantCultureIgnoreCase;
50+
4951
[XmlAttribute]
5052
[JsonProperty(Order = 1)]
5153
public UmbracoObjectTypes Name { get; set; }
@@ -56,7 +58,7 @@ public class ObjectTypeConfiguration : EntityConfiguration
5658
public EnabledRelationConfiguration Get(string alias)
5759
{
5860
return EnabledRelations
59-
.FirstOrDefault(r => r.Alias == alias)
61+
.FirstOrDefault(r => r.Alias.Equals(alias, IgnoreCase))
6062
?? new EnabledRelationConfiguration();
6163
}
6264

Umbraco.RelationEditor/RelationEditorEvents.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ namespace Umbraco.RelationEditor
1414
{
1515
public class RelationEditorEvents : ApplicationEventHandler
1616
{
17+
private static readonly StringComparer IgnoreCase = StringComparer.InvariantCultureIgnoreCase;
18+
1719
protected override void ApplicationStarted(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext)
1820
{
1921
base.ApplicationStarted(umbracoApplication, applicationContext);
@@ -50,7 +52,7 @@ private void TreeControllerBaseOnTreeNodesRendering(TreeControllerBase sender, T
5052
{
5153
var id = Convert.ToInt32(node.Id);
5254
var alias = EntityHelper.FindAlias(childObjectType, id);
53-
if (!childTypes.Contains(alias))
55+
if (!childTypes.Contains(alias, IgnoreCase))
5456
{
5557
node.SetNotPublishedStyle();
5658
node.AdditionalData.Add("relationDisallowed", "true");

Umbraco.RelationEditor/Umbraco.RelationEditor.csproj

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,9 @@
7979
<HintPath>..\packages\UmbracoCms.Core.7.0.2\lib\Microsoft.Web.Helpers.dll</HintPath>
8080
</Reference>
8181
<Reference Include="Microsoft.Web.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
82-
<Private>True</Private>
8382
<HintPath>..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll</HintPath>
83+
<SpecificVersion>False</SpecificVersion>
84+
<Private>True</Private>
8485
</Reference>
8586
<Reference Include="Microsoft.Web.Mvc.FixedDisplayModes">
8687
<HintPath>..\packages\Microsoft.AspNet.Mvc.FixedDisplayModes.1.0.1\lib\net40\Microsoft.Web.Mvc.FixedDisplayModes.dll</HintPath>
@@ -93,56 +94,68 @@
9394
</Reference>
9495
<Reference Include="Newtonsoft.Json, Version=4.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
9596
<HintPath>..\packages\Newtonsoft.Json.4.5.11\lib\net40\Newtonsoft.Json.dll</HintPath>
97+
<SpecificVersion>False</SpecificVersion>
9698
</Reference>
9799
<Reference Include="SQLCE4Umbraco">
98100
<HintPath>..\packages\UmbracoCms.Core.7.0.2\lib\SQLCE4Umbraco.dll</HintPath>
99101
</Reference>
100102
<Reference Include="System" />
101103
<Reference Include="System.Core" />
102104
<Reference Include="System.Data.SqlServerCe, Version=4.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
103-
<Private>True</Private>
104105
<HintPath>..\packages\UmbracoCms.Core.7.0.2\lib\System.Data.SqlServerCe.dll</HintPath>
106+
<SpecificVersion>False</SpecificVersion>
107+
<Private>True</Private>
105108
</Reference>
106109
<Reference Include="System.Data.SqlServerCe.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
107-
<Private>True</Private>
108110
<HintPath>..\packages\UmbracoCms.Core.7.0.2\lib\System.Data.SqlServerCe.Entity.dll</HintPath>
111+
<SpecificVersion>False</SpecificVersion>
112+
<Private>True</Private>
109113
</Reference>
110114
<Reference Include="System.Net.Http" />
111115
<Reference Include="System.Net.Http.Formatting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
112116
<HintPath>..\packages\Microsoft.AspNet.WebApi.Client.4.0.30506.0\lib\net40\System.Net.Http.Formatting.dll</HintPath>
117+
<SpecificVersion>False</SpecificVersion>
113118
</Reference>
114119
<Reference Include="System.Net.Http.WebRequest" />
115120
<Reference Include="System.Transactions" />
116121
<Reference Include="System.Web" />
117122
<Reference Include="System.Web.Helpers, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
118-
<Private>True</Private>
119123
<HintPath>..\packages\Microsoft.AspNet.WebPages.2.0.30506.0\lib\net40\System.Web.Helpers.dll</HintPath>
124+
<SpecificVersion>False</SpecificVersion>
125+
<Private>True</Private>
120126
</Reference>
121127
<Reference Include="System.Web.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
122128
<HintPath>..\packages\Microsoft.AspNet.WebApi.Core.4.0.30506.0\lib\net40\System.Web.Http.dll</HintPath>
129+
<SpecificVersion>False</SpecificVersion>
123130
</Reference>
124131
<Reference Include="System.Web.Http.WebHost, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
125132
<HintPath>..\packages\Microsoft.AspNet.WebApi.WebHost.4.0.30506.0\lib\net40\System.Web.Http.WebHost.dll</HintPath>
133+
<SpecificVersion>False</SpecificVersion>
126134
</Reference>
127135
<Reference Include="System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
128-
<Private>True</Private>
129136
<HintPath>..\packages\Microsoft.AspNet.Mvc.4.0.30506.0\lib\net40\System.Web.Mvc.dll</HintPath>
137+
<SpecificVersion>False</SpecificVersion>
138+
<Private>True</Private>
130139
</Reference>
131140
<Reference Include="System.Web.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
132-
<Private>True</Private>
133141
<HintPath>..\packages\Microsoft.AspNet.Razor.2.0.30506.0\lib\net40\System.Web.Razor.dll</HintPath>
142+
<SpecificVersion>False</SpecificVersion>
143+
<Private>True</Private>
134144
</Reference>
135145
<Reference Include="System.Web.WebPages, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
136-
<Private>True</Private>
137146
<HintPath>..\packages\Microsoft.AspNet.WebPages.2.0.30506.0\lib\net40\System.Web.WebPages.dll</HintPath>
147+
<SpecificVersion>False</SpecificVersion>
148+
<Private>True</Private>
138149
</Reference>
139150
<Reference Include="System.Web.WebPages.Deployment, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
140-
<Private>True</Private>
141151
<HintPath>..\packages\Microsoft.AspNet.WebPages.2.0.30506.0\lib\net40\System.Web.WebPages.Deployment.dll</HintPath>
152+
<SpecificVersion>False</SpecificVersion>
153+
<Private>True</Private>
142154
</Reference>
143155
<Reference Include="System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
144-
<Private>True</Private>
145156
<HintPath>..\packages\Microsoft.AspNet.WebPages.2.0.30506.0\lib\net40\System.Web.WebPages.Razor.dll</HintPath>
157+
<SpecificVersion>False</SpecificVersion>
158+
<Private>True</Private>
146159
</Reference>
147160
<Reference Include="System.Xml.Linq" />
148161
<Reference Include="System.Data.DataSetExtensions" />

0 commit comments

Comments
 (0)