Skip to content

Commit

Permalink
Fix DeprecationWarnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
mauritsvanrees committed Jan 20, 2025
1 parent dbb5595 commit 2570248
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion docs/portal.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Assuming there is a document `english_page` in a folder `en`, which is the navig
% invisible-code-block: python
%
% from plone import api
% from plone.app.layout.navigation.interfaces import INavigationRoot
% from plone.base.interfaces import INavigationRoot
% from zope.interface import alsoProvides
%
% portal = api.portal.get()
Expand Down
1 change: 1 addition & 0 deletions news/4090.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix DeprecationWarnings. [maurits]
4 changes: 2 additions & 2 deletions src/plone/api/portal.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from plone.api.exc import CannotGetPortalError
from plone.api.exc import InvalidParameterError
from plone.api.validation import required_parameters
from plone.app.layout.navigation.root import getNavigationRootObject
from plone.base.navigationroot import get_navigation_root_object
from plone.registry.interfaces import IRegistry
from Products.CMFCore.interfaces import ISiteRoot
from Products.CMFCore.utils import getToolByName
Expand Down Expand Up @@ -86,7 +86,7 @@ def get_navigation_root(context=None):
:Example: :ref:`portal-get-navigation-root-example`
"""
context = aq_inner(context)
return getNavigationRootObject(context, get())
return get_navigation_root_object(context, get())


@required_parameters("name")
Expand Down
2 changes: 1 addition & 1 deletion src/plone/api/relation.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
from plone.api.validation import required_parameters
from plone.app.linkintegrity.handlers import modifiedContent
from plone.app.linkintegrity.utils import referencedRelationship
from plone.base.utils import base_hasattr
from plone.dexterity.utils import iterSchemataForType
from Products.CMFPlone.utils import base_hasattr
from z3c.relationfield import event
from z3c.relationfield import RelationValue
from z3c.relationfield.schema import Relation
Expand Down
2 changes: 1 addition & 1 deletion src/plone/api/testing.zcml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
title="plone.api: Test fixture"
description="Extension profile to configure a test fixture"
provides="Products.GenericSetup.interfaces.EXTENSION"
for="Products.CMFPlone.interfaces.ITestCasePloneSiteRoot"
for="plone.base.interfaces.ITestCasePloneSiteRoot"
directory="profiles/testfixture"
/>

Expand Down
4 changes: 2 additions & 2 deletions src/plone/api/tests/test_content.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from plone.api.content import _parse_object_provides_query
from plone.api.tests.base import INTEGRATION_TESTING
from plone.app.contenttypes.interfaces import IFolder
from plone.app.layout.navigation.interfaces import INavigationRoot
from plone.base.interfaces import INavigationRoot
from plone.app.linkintegrity.exceptions import LinkIntegrityNotificationException
from plone.app.textfield import RichTextValue
from plone.indexer import indexer
Expand Down Expand Up @@ -192,7 +192,7 @@ def test_create_constraints(self):
folder.setConstrainTypesMode(ENABLED)
folder.setLocallyAllowedTypes(("News Item",))
else: # DX
from Products.CMFPlone.interfaces import ISelectableConstrainTypes
from plone.base.interfaces import ISelectableConstrainTypes

constraints = ISelectableConstrainTypes(folder)
constraints.setConstrainTypesMode(ENABLED)
Expand Down
2 changes: 1 addition & 1 deletion src/plone/api/tests/test_portal.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from plone.api import env
from plone.api import portal
from plone.api.tests.base import INTEGRATION_TESTING
from plone.app.layout.navigation.interfaces import INavigationRoot
from plone.base.interfaces import INavigationRoot
from plone.registry import field
from plone.registry.interfaces import IRegistry
from plone.registry.record import Record
Expand Down

0 comments on commit 2570248

Please sign in to comment.