diff --git a/src/Products/urban/LicenceConfig.py b/src/Products/urban/LicenceConfig.py index 973e869df..3f6abddab 100644 --- a/src/Products/urban/LicenceConfig.py +++ b/src/Products/urban/LicenceConfig.py @@ -339,6 +339,11 @@ def listUsedAttributes(self): ), ) ) + # Remove duplicates based on lowercase text while prioritizing lowercase entries + res = list({ + field_label.lower(): (field_name, field_label) + for field_name, field_label in sorted(res, key=lambda x: x[1].islower(), reverse=True) + }.values()) return DisplayList(tuple(res)).sortedByValue() def listLicenceConfigs(self): diff --git a/src/Products/urban/browser/urbanconfigview.py b/src/Products/urban/browser/urbanconfigview.py index 221ffeae5..ec9fda353 100644 --- a/src/Products/urban/browser/urbanconfigview.py +++ b/src/Products/urban/browser/urbanconfigview.py @@ -72,7 +72,10 @@ def getVocabularyFolders(self): for folder in context.objectValues("ATFolder") if folder not in other_folders ] - return folders + # Sort folders by their title attribute + sorted_folders = sorted(folders, key=lambda folder: folder.Title()) + + return sorted_folders def getScheduleConfigs(self): context = aq_inner(self.context) diff --git a/src/Products/urban/content/licence/GenericLicence.py b/src/Products/urban/content/licence/GenericLicence.py index 1882e8ff8..88a1bea47 100755 --- a/src/Products/urban/content/licence/GenericLicence.py +++ b/src/Products/urban/content/licence/GenericLicence.py @@ -1544,6 +1544,8 @@ def foldermanagersBaseQuery(self): dict = {} dict["path"] = {"query": "%s/portal_urban/foldermanagers" % (rootPath)} dict["id"] = ids + # add sort_on to sort the results of folder managers by the 'sortable_title' field + dict["sort_on"] = "sortable_title" return dict security.declarePublic("getParcels")