Skip to content

Commit

Permalink
Deprecate the portal_properties tool
Browse files Browse the repository at this point in the history
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
  • Loading branch information
ale-rt committed Sep 15, 2022
1 parent 3d03cf9 commit bfcf3fa
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
18 changes: 18 additions & 0 deletions Products/CMFPlone/PropertiesTool.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
from zope.component import getUtility
from zope.component import queryUtility
from Products.CMFCore.interfaces import ISiteRoot
from zope.deprecation import deprecate


@implementer(IPropertiesTool)
Expand Down Expand Up @@ -106,6 +107,15 @@ def title(self):
def smtp_server(self):
return getUtility(IMailHost).smtp_host


@deprecate(
"The portal portal_properties tool will be removed. "
"Use the portal_registry instead."
)
def hasProperty(self, id):
return super().hasProperty(id)


InitializeClass(PropertiesTool)


Expand All @@ -125,4 +135,12 @@ def __init__(self, id, title=''):
manage_options = (PropertyManager.manage_options
+ SimpleItem.manage_options)

@deprecate(
"The portal portal_properties tool will be removed. "
"Use the portal_registry instead."
)
def hasProperty(self, id):
return super().hasProperty(id)


InitializeClass(SimpleItemWithProperties)
1 change: 1 addition & 0 deletions news/125.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Deprecate the portal_properties tool

0 comments on commit bfcf3fa

Please sign in to comment.