diff --git a/CHANGES.rst b/CHANGES.rst index 470a1f5..2ceb4ba 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -8,6 +8,22 @@ Changelog .. towncrier release notes start +4.4.0 (2024-04-25) +------------------ + +New features: + + +- Import ILanguageSchema from plone.i18n.interfaces instead of Products.CMFPlone.interfaces.controlpanel. @ksuess + profile "plone.volto:multilingual": Add language german. @ksuess (#144) + + +Bug fixes: + + +- Avoid a deprecated import warnings in Plone 6. @davisagli (#147) + + 4.3.0 (2024-01-30) ------------------ diff --git a/news/144.feature b/news/144.feature deleted file mode 100644 index 0fc478d..0000000 --- a/news/144.feature +++ /dev/null @@ -1,2 +0,0 @@ -Import ILanguageSchema from plone.i18n.interfaces instead of Products.CMFPlone.interfaces.controlpanel. @ksuess -profile "plone.volto:multilingual": Add language german. @ksuess diff --git a/setup.py b/setup.py index 82a0d4a..08e5fe2 100644 --- a/setup.py +++ b/setup.py @@ -25,7 +25,7 @@ def readfile(name): setup( name="plone.volto", - version="4.3.1.dev0", + version="4.4.1.dev0", description="Volto integration add-on for Plone", long_description=long_description, # Get more from https://pypi.org/classifiers/ diff --git a/src/plone/volto/bbb.py b/src/plone/volto/bbb.py new file mode 100644 index 0000000..906d6de --- /dev/null +++ b/src/plone/volto/bbb.py @@ -0,0 +1,11 @@ +# flake8: noqa + +try: + from plone.base.interfaces import IPloneSiteRoot +except ImportError: + from Products.CMFPlone.interfaces import IPloneSiteRoot + +try: + from plone.base.utils import get_installer +except ImportError: + from Products.CMFPlone.utils import get_installer diff --git a/src/plone/volto/browser/breadcrumbs.py b/src/plone/volto/browser/breadcrumbs.py index b9c3b75..bdb1574 100644 --- a/src/plone/volto/browser/breadcrumbs.py +++ b/src/plone/volto/browser/breadcrumbs.py @@ -6,13 +6,19 @@ from Products.CMFPlone import utils from Products.CMFPlone.browser.interfaces import INavigationBreadcrumbs from Products.CMFPlone.browser.navigation import get_view_url -from Products.CMFPlone.defaultpage import check_default_page_via_view -from Products.CMFPlone.interfaces import IHideFromBreadcrumbs from Products.Five import BrowserView from zope.component import getMultiAdapter from zope.interface import implementer +try: + from plone.base.defaultpage import check_default_page_via_view + from plone.base.interfaces import IHideFromBreadcrumbs +except ImportError: + from Products.CMFPlone.defaultpage import check_default_page_via_view + from Products.CMFPlone.interfaces import IHideFromBreadcrumbs + + @implementer(INavigationBreadcrumbs) class PhysicalNavigationBreadcrumbs(BrowserView): def breadcrumbs(self): diff --git a/src/plone/volto/browser/migrate_to_volto.py b/src/plone/volto/browser/migrate_to_volto.py index 8eba43b..d5c58b9 100644 --- a/src/plone/volto/browser/migrate_to_volto.py +++ b/src/plone/volto/browser/migrate_to_volto.py @@ -8,12 +8,12 @@ from plone.app.redirector.interfaces import IRedirectionStorage from plone.app.textfield.value import RichTextValue from plone.dexterity.interfaces import IDexterityFTI +from plone.volto.bbb import get_installer from plone.volto.browser.migrate_richtext import get_blocks_from_richtext from plone.volto.browser.migrate_richtext import migrate_richtext_to_blocks from Products.BTreeFolder2.BTreeFolder2 import BTreeFolder2Base from Products.CMFCore.utils import getToolByName from Products.CMFPlone.relationhelper import restore_relations -from Products.CMFPlone.utils import get_installer from Products.Five import BrowserView from uuid import uuid4 from zope.component import getUtility diff --git a/src/plone/volto/browser/navigation.py b/src/plone/volto/browser/navigation.py index f2b01d6..5c86929 100644 --- a/src/plone/volto/browser/navigation.py +++ b/src/plone/volto/browser/navigation.py @@ -8,13 +8,18 @@ from Products.CMFPlone.browser.interfaces import INavigationTabs from Products.CMFPlone.browser.navigation import get_id from Products.CMFPlone.browser.navigation import get_view_url -from Products.CMFPlone.interfaces import INavigationSchema from Products.Five import BrowserView from zope.component import getMultiAdapter from zope.component import getUtility from zope.interface import implementer +try: + from plone.base.interfaces import INavigationSchema +except ImportError: + from Products.CMFPlone.interfaces import INavigationSchema + + @implementer(INavigationTabs) class CatalogNavigationTabs(BrowserView): def _getNavQuery(self): diff --git a/src/plone/volto/configure.zcml b/src/plone/volto/configure.zcml index 8de14e0..750c602 100644 --- a/src/plone/volto/configure.zcml +++ b/src/plone/volto/configure.zcml @@ -22,14 +22,14 @@ diff --git a/src/plone/volto/setuphandlers.py b/src/plone/volto/setuphandlers.py index 3aa3072..eac653d 100644 --- a/src/plone/volto/setuphandlers.py +++ b/src/plone/volto/setuphandlers.py @@ -2,12 +2,12 @@ from importlib import import_module from plone import api from plone.dexterity.interfaces import IDexterityFTI +from plone.volto.bbb import get_installer from plone.volto.default_homepage.default import default_home from plone.volto.default_homepage.demo import demo_home_page from plone.volto.default_homepage.lrf import default_lrf_home from Products.CMFCore.utils import getToolByName from Products.CMFPlone.interfaces import INonInstallable -from Products.CMFPlone.utils import get_installer from zope.component import queryUtility from zope.interface import implementer diff --git a/src/plone/volto/tests/test_migrate_to_volto.py b/src/plone/volto/tests/test_migrate_to_volto.py index 0fe7fe5..e07cf77 100644 --- a/src/plone/volto/tests/test_migrate_to_volto.py +++ b/src/plone/volto/tests/test_migrate_to_volto.py @@ -3,12 +3,12 @@ from plone.app.testing import setRoles from plone.app.testing import TEST_USER_ID from plone.app.textfield.value import RichTextValue +from plone.volto.bbb import get_installer from plone.volto.content import FolderishDocument from plone.volto.content import FolderishEvent from plone.volto.content import FolderishNewsItem from plone.volto.testing import PLONE_6 from plone.volto.testing import PLONE_VOLTO_MIGRATION_FUNCTIONAL_TESTING -from Products.CMFPlone.utils import get_installer import json import responses diff --git a/src/plone/volto/tests/test_setup.py b/src/plone/volto/tests/test_setup.py index 8c4aede..718ef96 100644 --- a/src/plone/volto/tests/test_setup.py +++ b/src/plone/volto/tests/test_setup.py @@ -2,16 +2,9 @@ """Setup tests for this package.""" from importlib import import_module from plone import api +from plone.volto.bbb import get_installer from plone.volto.testing import PLONE_VOLTO_CORE_INTEGRATION_TESTING # noqa - -try: - from Products.CMFPlone.utils import get_installer -except ImportError: # Plone < 5.1 - HAS_INSTALLER = False -else: - HAS_INSTALLER = True - import unittest @@ -26,17 +19,11 @@ class TestSetup(unittest.TestCase): def setUp(self): """Custom shared utility setup for tests.""" self.portal = self.layer["portal"] - if HAS_INSTALLER: - self.installer = get_installer(self.portal) - else: - self.installer = api.portal.get_tool("portal_quickinstaller") + self.installer = get_installer(self.portal) def test_product_installed(self): """Test if plone.volto is installed.""" - if HAS_INSTALLER: - self.assertTrue(self.installer.is_product_installed("plone.volto")) - else: - self.assertTrue(self.installer.isProductInstalled("plone.volto")) + self.assertTrue(self.installer.is_product_installed("plone.volto")) def test_browserlayer(self): """Test that IPloneVoltoCoreLayer is registered.""" @@ -70,19 +57,12 @@ class TestUninstall(unittest.TestCase): def setUp(self): self.portal = self.layer["portal"] - if HAS_INSTALLER: - self.installer = get_installer(self.portal) - self.installer.uninstall_product("plone.volto") - else: - self.installer = api.portal.get_tool("portal_quickinstaller") - self.installer.uninstallProducts(["plone.volto"]) + self.installer = get_installer(self.portal) + self.installer.uninstall_product("plone.volto") def test_product_uninstalled(self): """Test if plone.volto is cleanly uninstalled.""" - if HAS_INSTALLER: - self.assertFalse(self.installer.is_product_installed("plone.volto")) - else: - self.assertFalse(self.installer.isProductInstalled("plone.volto")) + self.assertFalse(self.installer.is_product_installed("plone.volto")) def test_browserlayer_removed(self): """Test that IPloneVoltoCoreLayer is removed.""" diff --git a/src/plone/volto/transforms.py b/src/plone/volto/transforms.py index 1635520..ef6def5 100644 --- a/src/plone/volto/transforms.py +++ b/src/plone/volto/transforms.py @@ -4,7 +4,7 @@ from plone.restapi.interfaces import IBlockFieldSerializationTransformer from plone.restapi.interfaces import IBlockVisitor from plone.restapi.serializer.blocks import ResolveUIDSerializerBase -from Products.CMFPlone.interfaces import IPloneSiteRoot +from plone.volto.bbb import IPloneSiteRoot from zope.component import adapter from zope.component import subscribers from zope.interface import implementer