Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove portal_properties Tool. #125

Closed
tisto opened this issue Nov 7, 2013 · 7 comments
Closed

Remove portal_properties Tool. #125

tisto opened this issue Nov 7, 2013 · 7 comments

Comments

@tisto
Copy link
Member

tisto commented Nov 7, 2013

Once all settings have been moved to plone.app.registry, we should be able to remove portal_properties.

@davisagli
Copy link
Member

This needs to include adding documentation to the upgrade guide for how add-on authors using property sheets in portal_properties can move their settings to the registry.

@esteele
Copy link
Member

esteele commented Sep 20, 2015

All of the properties currently set by Plone core have been migrated to the configuration registry. I think we can mark PropertiesTool as deprecated in 5.0 and remove in 5.1.

@vangheem
Copy link
Member

vangheem commented Feb 2, 2016

Moved from plip to bug. We need to mark it as deprecated and fully remove this in 6 IMO.

@jensens jensens modified the milestones: Plone 5.1, Plone 6.0 Aug 13, 2018
@pbauer
Copy link
Member

pbauer commented Feb 5, 2019

How do we properly deprecate portal_properties? ONe option is to simplyt mention it in the release notes. Another would be to throw deprecation warnings when accessing properties or creating propertysheets. (i.e. decorating addPropertySheet, _setPropValue and getProperty)

jensens pushed a commit that referenced this issue Nov 12, 2021
ale-rt added a commit that referenced this issue Sep 15, 2022
The tool gets most of the methods from OFS.PropertyManager.

The most relevant are using internally the hasProperty method.

Deprecating this should be enough to finally start removing this
obsolete tool and a bunch of code that depends on that.

Refs. #125
ale-rt added a commit that referenced this issue Nov 6, 2022
The class TestBaseNavTree is not used anymore and its tests are not run.
It is still assuming that the configuration is stored in the
portal_properties tool, while it is in the registry since quite some
time.

Another step towards #125
ale-rt added a commit that referenced this issue Nov 6, 2022
The class TestBaseNavTree is not used anymore and its tests are not run.
It is still assuming that the configuration is stored in the
portal_properties tool, while it is in the registry since quite some
time.

Another step towards #125
ale-rt added a commit that referenced this issue Nov 6, 2022
The test was still assuming that the navigation root configuration
is stored in the portal properties while it is in the registry since
quite some time.

Adapt the test to check that nothing breaks when tweaking the registry.

Refs. #125
@jensens jensens modified the milestones: Plone 6.0, Plone 6.1 Mar 12, 2023
@mauritsvanrees mauritsvanrees moved this to Todo in Plone 6.1 May 31, 2023
@mauritsvanrees
Copy link
Member

When running some tests, I saw this warning again:

DeprecationWarning:
The portal portal_properties tool will be removed in Plone 6.1.
Use the portal_registry instead.
Check https://github.com/plone/Products.CMFPlone/issues/125 for more details.

I have added the current issue to the Plone 6.1 project board.

Grepping for portal_properties only in Python code already pulls up a lot of lines. Some will be for backward compatibility and can simply be removed. I hope this is true for all.

$ ack --python portal_properties
Products/CMFPlone/tests/testPortalCreation.py
45:        self.properties = self.portal.portal_properties
951:        self.properties = self.portal.portal_properties

Products/CMFPlone/tests/testNavigationView.py
126:        ntp = self.portal.portal_properties.navtree_properties
137:        ntp = self.portal.portal_properties.navtree_properties

Products/CMFPlone/tests/test_zmi.py
124:    def test_portal_properties(self):
125:        url = "portal_properties/manage_main"

Products/CMFPlone/tests/testWebDAV.py
23:        ptool = getToolByName(self.portal, "portal_properties")

Products/CMFPlone/PropertiesTool.py
28:    id = "portal_properties"
84:    #   'portal_properties' interface methods
107:        "The portal portal_properties tool will be removed in Plone 6.1. "
135:        "The portal portal_properties tool will be removed in Plone 6.1. "

Products/CMFPlone/setuphandlers.py
78:        "portal_properties": "General settings registry",

Products/CMFPlone/browser/author.py
200:        self.portal_properties = getUtility(IPropertiesTool)

Products/CMFPlone/exportimport/tests/testPropertiesTool.py
18:<object name="portal_properties" meta_type="Plone Properties Tool">

Products/CMFPlone/exportimport/propertiestool.py
25:    ptool = getToolByName(site, "portal_properties")
44:    ptool = getToolByName(site, "portal_properties", None)

Products/CMFCore/interfaces/_tools.py
1089:                   o Must be set to 'portal_properties'.

plone/app/portlets/portlets/navigation.py
409:        portal_properties = getToolByName(context, "portal_properties")
410:        navtree_properties = getattr(portal_properties, "navtree_properties")

plone/app/vocabularies/types.py
44:    portal_properties = getToolByName(context, "portal_properties", None)
45:    if portal_properties is not None:
47:    site_properties = getattr(portal_properties, "site_properties", None)
119:      >>> tool = DummyTool('portal_properties')
127:      >>> context.portal_properties = tool

plone/app/upgrade/tests/base.py
64:        # Removes a site property from portal_properties
65:        tool = getToolByName(self.portal, "portal_properties")
71:        # adds a site property to portal_properties
72:        tool = getToolByName(self.portal, "portal_properties")
78:        # Removes a navtree property from portal_properties
79:        tool = getToolByName(self.portal, "portal_properties")
85:        # adds a navtree property to portal_properties
86:        tool = getToolByName(self.portal, "portal_properties")

plone/app/layout/globals/interfaces.py
79:        """The portal_properties tool"""

plone/app/layout/globals/tools.py
26:        return getToolByName(self.context, "portal_properties")

plone/app/layout/globals/tests/test_tools.py
34:            self.view.properties(), getToolByName(self.folder, "portal_properties")

plone/app/layout/sitemap/tests/test_sitemap.py
48:            self.portal, "portal_properties"

plone/app/textfield/utils.py
26:    """Get a set of allowed MIME types according to the portal_properties
42:        portal_properties = getToolByName(site, "portal_properties", None)
43:        if portal_properties is None:
46:        site_properties = portal_properties.get("site_properties", None)

plone/app/textfield/tests.py
299:        self.portal["portal_properties"]["site_properties"]._setPropValue(
333:        self.portal["portal_properties"]["site_properties"]._setPropValue(

plone/app/querystring/tests/testQueryParser.py
107:        self.portal_properties = MockSiteProperties()

plone/app/users/browser/registersettingspanel.py
80:        pprop = getToolByName(self.context, "portal_properties")

plone/app/contenttypes/setuphandlers.py
135:    portal_properties = getToolByName(portal, "portal_properties")
136:    site_properties = portal_properties.site_properties

plone/restapi/services/contextnavigation/get.py
628:        portal_properties = getToolByName(context, "portal_properties")
629:        navtree_properties = getattr(portal_properties, "navtree_properties")

plone/api/tests/test_user.py
51:            portal.portal_properties.site_properties.use_email_as_login = value

plone/api/tests/test_portal.py
124:            # before Plone 4.3, date formats were stored in portal_properties
125:            properties = portal.get_tool("portal_properties")

plone/dexterity/content.py
70:    "portal_properties",

plone/base/navigationroot.py
18:    portal_properties, navigation root path is computed from
35:        # fetch from portal_properties

plone/base/interfaces/properties.py
9:    id = Attribute("id", 'Must be set to "portal_properties"')

@jensens
Copy link
Member

jensens commented Jun 4, 2023

it worth the effort and would clean our code.

mauritsvanrees added a commit to plone/plone.app.querystring that referenced this issue Jun 6, 2024
mister-roboto pushed a commit to plone/buildout.coredev that referenced this issue Jun 7, 2024
Branch: refs/heads/master
Date: 2024-06-06T16:41:29+02:00
Author: Maurits van Rees (mauritsvanrees) <[email protected]>
Commit: plone/plone.app.querystring@4d1d39a

Remove unused portal_properties code from tests.

Refs plone/Products.CMFPlone#125

Files changed:
A news/125.tests
M plone/app/querystring/tests/testQueryParser.py
Repository: plone.app.querystring

Branch: refs/heads/master
Date: 2024-06-06T16:42:19+02:00
Author: Maurits van Rees (mauritsvanrees) <[email protected]>
Commit: plone/plone.app.querystring@bf177ba

Configuring with plone/meta

Files changed:
A dependabot.yml
M .editorconfig
M .github/workflows/meta.yml
M .meta.toml
M pyproject.toml
M tox.ini
Repository: plone.app.querystring

Branch: refs/heads/master
Date: 2024-06-07T10:08:25-04:00
Author: Jens W. Klein (jensens) <[email protected]>
Commit: plone/plone.app.querystring@c0eb00f

Merge pull request #150 from plone/remove-portal-properties-tool

Remove portal properties tool from tests

Files changed:
A dependabot.yml
A news/125.tests
M .editorconfig
M .github/workflows/meta.yml
M .meta.toml
M plone/app/querystring/tests/testQueryParser.py
M pyproject.toml
M tox.ini
mister-roboto pushed a commit to plone/buildout.coredev that referenced this issue Jun 7, 2024
Branch: refs/heads/master
Date: 2024-06-06T16:41:29+02:00
Author: Maurits van Rees (mauritsvanrees) <[email protected]>
Commit: plone/plone.app.querystring@4d1d39a

Remove unused portal_properties code from tests.

Refs plone/Products.CMFPlone#125

Files changed:
A news/125.tests
M plone/app/querystring/tests/testQueryParser.py
Repository: plone.app.querystring

Branch: refs/heads/master
Date: 2024-06-06T16:42:19+02:00
Author: Maurits van Rees (mauritsvanrees) <[email protected]>
Commit: plone/plone.app.querystring@bf177ba

Configuring with plone/meta

Files changed:
A dependabot.yml
M .editorconfig
M .github/workflows/meta.yml
M .meta.toml
M pyproject.toml
M tox.ini
Repository: plone.app.querystring

Branch: refs/heads/master
Date: 2024-06-07T10:08:25-04:00
Author: Jens W. Klein (jensens) <[email protected]>
Commit: plone/plone.app.querystring@c0eb00f

Merge pull request #150 from plone/remove-portal-properties-tool

Remove portal properties tool from tests

Files changed:
A dependabot.yml
A news/125.tests
M .editorconfig
M .github/workflows/meta.yml
M .meta.toml
M plone/app/querystring/tests/testQueryParser.py
M pyproject.toml
M tox.ini
@mauritsvanrees
Copy link
Member

All done, and released in Plone 6.1.0a4 two weeks ago.
Closing issue 125. :-)

@github-project-automation github-project-automation bot moved this from Todo to Done in Plone 6.1 Aug 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

No branches or pull requests

7 participants