From f59a196b3e7f1e89ef770c67b8e38da20ea81d1d Mon Sep 17 00:00:00 2001 From: "Jens W. Klein" Date: Mon, 4 Jul 2022 13:07:29 +0200 Subject: [PATCH] fix deprecation warnings from plone.base --- news/166.bugfix | 2 ++ plone/app/portlets/portlets/navigation.py | 15 ++++++++------- 2 files changed, 10 insertions(+), 7 deletions(-) create mode 100644 news/166.bugfix diff --git a/news/166.bugfix b/news/166.bugfix new file mode 100644 index 00000000..3590a460 --- /dev/null +++ b/news/166.bugfix @@ -0,0 +1,2 @@ +fix deprecation warnings from plone.base +[jensens] diff --git a/plone/app/portlets/portlets/navigation.py b/plone/app/portlets/portlets/navigation.py index 4d5c4f4c..124c6049 100644 --- a/plone/app/portlets/portlets/navigation.py +++ b/plone/app/portlets/portlets/navigation.py @@ -12,6 +12,11 @@ from plone.app.layout.navigation.root import getNavigationRootObject from plone.app.uuid.utils import uuidToObject from plone.app.vocabularies.catalog import CatalogSource +from plone.base.defaultpage import is_default_page +from plone.base.interfaces import INavigationSchema +from plone.base.interfaces import INonStructuralFolder +from plone.base.interfaces import ISiteSchema +from plone.base.utils import safe_callable from plone.i18n.normalizer.interfaces import IIDNormalizer from plone.memoize.instance import memoize from plone.portlets.interfaces import IPortletDataProvider @@ -19,12 +24,8 @@ from Products.CMFCore.interfaces import ISiteRoot from Products.CMFCore.utils import getToolByName from Products.CMFDynamicViewFTI.interfaces import IBrowserDefault -from Products.CMFPlone import utils from Products.CMFPlone.browser.navtree import SitemapNavtreeStrategy -from Products.CMFPlone.defaultpage import is_default_page -from Products.CMFPlone.interfaces import INavigationSchema -from Products.CMFPlone.interfaces import INonStructuralFolder -from Products.CMFPlone.interfaces import ISiteSchema +from Products.CMFPlone.utils import typesToList from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile from Products.MimetypesRegistry.MimeTypeItem import guess_icon_path from zExceptions import NotFound @@ -414,7 +415,7 @@ def __init__(self, context, portlet): # Acquire a custom nav query if available customQuery = getattr(context, "getCustomNavQuery", None) - if customQuery is not None and utils.safe_callable(customQuery): + if customQuery is not None and safe_callable(customQuery): query = customQuery() else: query = {} @@ -444,7 +445,7 @@ def __init__(self, context, portlet): # seem to work with EPI. # Only list the applicable types - query["portal_type"] = utils.typesToList(context) + query["portal_type"] = typesToList(context) # Apply the desired sort sortAttribute = navtree_properties.getProperty("sortAttribute", None)