Skip to content

Commit

Permalink
Merge branch 'main' into nonfolderish_tabs
Browse files Browse the repository at this point in the history
  • Loading branch information
davisagli authored Apr 29, 2024
2 parents b5fba21 + 4504635 commit 2601bf9
Show file tree
Hide file tree
Showing 12 changed files with 54 additions and 38 deletions.
16 changes: 16 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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)
------------------

Expand Down
2 changes: 0 additions & 2 deletions news/144.feature

This file was deleted.

2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand Down
11 changes: 11 additions & 0 deletions src/plone/volto/bbb.py
Original file line number Diff line number Diff line change
@@ -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
10 changes: 8 additions & 2 deletions src/plone/volto/browser/breadcrumbs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion src/plone/volto/browser/migrate_to_volto.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 6 additions & 1 deletion src/plone/volto/browser/navigation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
4 changes: 2 additions & 2 deletions src/plone/volto/configure.zcml
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@

<browser:page
name="blocksuuidfixer"
for="Products.CMFPlone.interfaces.IPloneSiteRoot"
for=".bbb.IPloneSiteRoot"
class=".blocksuuidfixer.DuplicatedBlocksUUIDFixer"
permission="cmf.ManagePortal"
/>

<browser:page
name="volto_settings"
for="Products.CMFPlone.interfaces.IPloneSiteRoot"
for=".bbb.IPloneSiteRoot"
class=".controlpanel.VoltoSettingsControlPanel"
permission="cmf.ManagePortal"
/>
Expand Down
2 changes: 1 addition & 1 deletion src/plone/volto/setuphandlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion src/plone/volto/tests/test_migrate_to_volto.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
32 changes: 6 additions & 26 deletions src/plone/volto/tests/test_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand All @@ -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."""
Expand Down Expand Up @@ -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."""
Expand Down
2 changes: 1 addition & 1 deletion src/plone/volto/transforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2601bf9

Please sign in to comment.