Skip to content

Commit

Permalink
Remove use of portal_properties in context navigation.
Browse files Browse the repository at this point in the history
Theoretically we checked `portal_properties.site_properties.sortAttribute`.
  • Loading branch information
mauritsvanrees committed Jun 15, 2024
1 parent 58fe86b commit 47e12dc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
3 changes: 3 additions & 0 deletions news/125.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Remove use of `portal_properties` in context navigation.
Theoretically we checked `portal_properties.site_properties.sortAttribute`.
[maurits]
11 changes: 0 additions & 11 deletions src/plone/restapi/services/contextnavigation/get.py
Original file line number Diff line number Diff line change
Expand Up @@ -625,9 +625,6 @@ def __init__(self, context, data):
self.context = context
self.data = data

portal_properties = getToolByName(context, "portal_properties")
navtree_properties = getattr(portal_properties, "navtree_properties")

# Acquire a custom nav query if available
customQuery = getattr(context, "getCustomNavQuery", None)
if customQuery is not None and safe_callable(customQuery):
Expand Down Expand Up @@ -668,14 +665,6 @@ def __init__(self, context, data):
# Only list the applicable types
query["portal_type"] = typesToList(context)

# Apply the desired sort
sortAttribute = navtree_properties.getProperty("sortAttribute", None)
if sortAttribute is not None:
query["sort_on"] = sortAttribute
sortOrder = navtree_properties.getProperty("sortOrder", None)
if sortOrder is not None:
query["sort_order"] = sortOrder

# Filter on workflow states, if enabled
registry = getUtility(IRegistry)
navigation_settings = registry.forInterface(INavigationSchema, prefix="plone")
Expand Down

0 comments on commit 47e12dc

Please sign in to comment.