Help - plone 6.1 ConfigurationConflictError when a behavior is declared: Is configure.zcml being loaded twice?

Hi,

I declared my first behavior in behaviors/configure.zcml in Plone 6.1 classic:

<include package="plone.behavior" file="meta.zcml"/>
<plone:behavior
title="Megamenu Extra Image Field"
description="Adds an image field only to MegamenuColumnV2."
provides="por.intrasite.behaviors.megamenu_extra.IExtraMegamenuFields"
name="por.intrasite.behaviors.megamenu_extra.IExtraMegamenuFields"
/>

When I run bin/client fg, I get the following error:

File "/srv/data/por_site/eggs/Zope-5.12-py3.12.egg/Zope2/App/startup.py", line 41, in load_zcml
load_site()
File "/srv/data/por_site/eggs/Zope-5.12-py3.12.egg/Zope2/App/zcml.py", line 45, in load_site
_context = xmlconfig.file(site_zcml)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/srv/data/por_site/eggs/zope.configuration-6.0-py3.12.egg/zope/configuration/xmlconfig.py", line 719, in file
context.execute_actions()
File "/srv/data/por_site/eggs/zope.configuration-6.0-py3.12.egg/zope/configuration/config.py", line 828, in execute_actions
for action in resolveConflicts(self.actions):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/srv/data/por_site/eggs/zope.configuration-6.0-py3.12.egg/zope/configuration/config.py", line 1891, in resolveConflicts
raise ConfigurationConflictError(conflicts)
zope.configuration.config.ConfigurationConflictError: Conflicting configuration actions
For: ('utility', , 'por.intrasite.behaviors.megamenu_extra.IExtraMegamenuFields')
File "/srv/data/por_site/src/por.intrasite/src/por/intrasite/behaviors/configure.zcml", line 16.2-21.4
<plone:behavior
title="Megamenu Extra Image Field"
description="Adds an image field only to MegamenuColumnV2."
provides="por.intrasite.behaviors.megamenu_extra.IExtraMegamenuFields"
name="por.intrasite.behaviors.megamenu_extra.IExtraMegamenuFields"
/>
File "/srv/data/por_site/src/por.intrasite/src/por/intrasite/behaviors/configure.zcml", line 16.2-21.4
<plone:behavior
title="Megamenu Extra Image Field"
description="Adds an image field only to MegamenuColumnV2."
provides="por.intrasite.behaviors.megamenu_extra.IExtraMegamenuFields"
name="por.intrasite.behaviors.megamenu_extra.IExtraMegamenuFields"
/>

ChatGPT suggests that behaviors/configure.zcml is being loaded twice.

Here's what I've checked:

  • There is no duplication of por.intrasite in the eggs section of any .cfg file.
  • There are no explicit zcml entries in my .cfg files.
  • There are no recursive <include package...> directives involving por.intrasite.
  • No other packages have an <include package="por.intrasite"> directive.

In src/por.intrasite/setup.py, I have:

entry_points="""
[z3c.autoinclude.plugin]
target = plone

And por.intrasite is in the eggs list of the [buildout] section. ChatGPT suggested this might be the cause, but I don't believe it, as this is a standard setup for a Plone add-on.

Could you please provide some ideas on what might be causing this? Many thanks for your time.

try to change the name to something different, something like por.intrasite.megamenu_extra. More on behaviors:

A bit off topic, but behaviors can be added with plonecli

plonecli add behavior

Thank you @yuri ! you are golden :slight_smile:

thx Espen too!

1 Like