Merge pull request #5090 from deMD/temp8-5069-getTreePackageFolder-use-localeCompare

V8 Plugins: Changed treeService.getTreePackageFolder to use localeCompare
This commit is contained in:
Sebastiaan Janssen
2019-04-18 12:42:17 +02:00
committed by GitHub

View File

@@ -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;