Merge pull request #5090 from deMD/temp8-5069-getTreePackageFolder-use-localeCompare
V8 Plugins: Changed treeService.getTreePackageFolder to use localeCompare
This commit is contained in:
@@ -165,8 +165,9 @@ function treeService($q, treeResource, iconHelper, notificationsService, eventsS
|
||||
Umbraco.Sys.ServerVariables.umbracoPlugins.trees &&
|
||||
angular.isArray(Umbraco.Sys.ServerVariables.umbracoPlugins.trees)) {
|
||||
|
||||
var found = _.find(Umbraco.Sys.ServerVariables.umbracoPlugins.trees, function(item) {
|
||||
return item.alias === treeAlias;
|
||||
var found = _.find(Umbraco.Sys.ServerVariables.umbracoPlugins.trees, function (item) {
|
||||
// localeCompare returns 0 when strings are equal, so return false if there's no match
|
||||
return item.alias.localeCompare(treeAlias, undefined, { ignorePunctuation: true }) !== 0;
|
||||
});
|
||||
|
||||
return found ? found.packageFolder : undefined;
|
||||
|
||||
Reference in New Issue
Block a user