diff --git a/news/3858.internal b/news/3858.internal new file mode 100644 index 0000000..8df2515 --- /dev/null +++ b/news/3858.internal @@ -0,0 +1,5 @@ +Mark ``INameFromTitle`` deprecated, in this distribution, as it has been moved to ``plone.base``. +It will be removed in Plone 7.0. +We do not show a deprecation warning, because doing so would break content types with this interface name in the behaviors list. +Recommended is to use ``plone.namefromtitle`` as behavior name, then it works in all supported Plone versions. +[gforcada] diff --git a/news/3858.internal.2 b/news/3858.internal.2 deleted file mode 100644 index c672f40..0000000 --- a/news/3858.internal.2 +++ /dev/null @@ -1,4 +0,0 @@ -Mark `INameFromTitle` deprecated, in this distribution, -as it has been moved to `plone.base`. -The deprecation warning is set for Plone 7.0. -[gforcada] diff --git a/plone/app/content/interfaces.py b/plone/app/content/interfaces.py index 94b0a4d..ebd7916 100644 --- a/plone/app/content/interfaces.py +++ b/plone/app/content/interfaces.py @@ -1,14 +1,30 @@ +from plone.base.interfaces import INameFromTitle as FutureINameFromTitle from zope.interface import Attribute from zope.interface import Interface -import zope.deferredimport +class INameFromTitle(FutureINameFromTitle): + """An object that supports getting its name (id) from its title. -zope.deferredimport.deprecated( - "It has been moved to plone.base.interfaces. " - "This alias will be removed in Plone 7.0", - INameFromTitle="plone.base.interfaces:INameFromTitle", -) + This interface has been moved to plone.base.interfaces. + This alias will be removed in Plone 7.0. + We tried deprecating it like this: + + zope.deferredimport.deprecated( + INameFromTitle="plone.base.interfaces:INameFromTitle", + ) + + Unfortunately this does not completely work: if your site has a content + type with behavior `plone.app.content.interfaces.INameFromTitle` this would + no longer work because the behavior is not found. + If you use `plone.namefromtitle` then it works. + + So as long as we want to support the old spelling, we must keep the + interface here, and also use this interface as the `provides` in the + definition of the behavior in `plone.app.dexterity`. + + See https://github.com/plone/plone.app.dexterity/pull/379 + """ class IReindexOnModify(Interface):