Skip to content

Commit

Permalink
Make the dependency on plone.app.content conditional.
Browse files Browse the repository at this point in the history
This is for `INameFromTitle`, which we want to move to `plone.base`.
See #379 (comment) for why this is not working yet, and we need this workaround.
  • Loading branch information
mauritsvanrees committed Oct 31, 2023
1 parent a8a8ae5 commit e9466e8
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .meta.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ commit-id = "55bda5c9"

[pyproject]
codespell_ignores = "hove"
dependencies_ignores = "['plone.app.relationfield', 'plone.directives.form', 'plone.directives.dexterity', 'five.grok', 'plone.app.intid', 'plone.contentrules', 'plone.schema', 'z3c.relationfield']"
dependencies_ignores = "['plone.app.content', 'plone.app.relationfield', 'plone.directives.form', 'plone.directives.dexterity', 'five.grok', 'plone.app.intid', 'plone.contentrules', 'plone.schema', 'z3c.relationfield']"

[flake8]
extra_lines = """
Expand Down
3 changes: 3 additions & 0 deletions news/3858.internal
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Make the dependency on ``plone.app.content`` conditional.
This is for ``INameFromTitle``, which we want to move to ``plone.base``.
[maurits]
32 changes: 17 additions & 15 deletions plone/app/dexterity/behaviors/configure.zcml
Original file line number Diff line number Diff line change
Expand Up @@ -59,23 +59,25 @@
for="plone.dexterity.interfaces.IDexterityContent"
/>

<!-- Title-to-id -->
<plone:behavior
name="plone.namefromtitle"
title="Name from title"
description="Automatically generate short URL name for content based on its initial title"
provides="plone.app.content.interfaces.INameFromTitle"
/>
<configure zcml:condition="installed plone.app.content">
<!-- Title-to-id -->
<plone:behavior
name="plone.namefromtitle"
title="Name from title"
description="Automatically generate short URL name for content based on its initial title"
provides="plone.app.content.interfaces.INameFromTitle"
/>

<!-- File-name-to-id -->
<plone:behavior
name="plone.namefromfilename"
title="Name from file name"
description="Automatically generate short URL name for content based on its primary field file name"
provides=".filename.INameFromFileName"
/>
<!-- File-name-to-id -->
<plone:behavior
name="plone.namefromfilename"
title="Name from file name"
description="Automatically generate short URL name for content based on its primary field file name"
provides=".filename.INameFromFileName"
/>

<adapter factory=".filename.NameFromFileName" />
<adapter factory=".filename.NameFromFileName" />
</configure>

<!-- Navigation root -->
<plone:behavior
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ Zope = [
'Products.CMFCore', 'Products.CMFDynamicViewFTI',
]
python-dateutil = ['dateutil']
ignore-packages = ['plone.app.relationfield', 'plone.directives.form', 'plone.directives.dexterity', 'five.grok', 'plone.app.intid', 'plone.contentrules', 'plone.schema', 'z3c.relationfield']
ignore-packages = ['plone.app.content', 'plone.app.relationfield', 'plone.directives.form', 'plone.directives.dexterity', 'five.grok', 'plone.app.intid', 'plone.contentrules', 'plone.schema', 'z3c.relationfield']

##
# Add extra configuration options in .meta.toml:
Expand Down
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@
# Plone/Zope core
"lxml",
"plone.base",
"plone.app.content",
"plone.app.uuid",
"plone.app.z3cform>=1.1.0",
"plone.autoform>=1.1",
Expand Down

0 comments on commit e9466e8

Please sign in to comment.