I did try to use includeOverrides
without success. Actually I almost never got this includeOverrides feature to do what I want, so ...
I'd just register the orderedselect_input.js
under a different name. in the end it doesn't matter if it's shipping a resource which would elsewhere eventually be available, more so because dm.zope.profile
will/should only be installed in development environments.
Overrides work in a strange way: ZCML registrations are organized in a hierarchical (package include) structure and registrations on an ancestor level override those on descendant levels. All includeOverrides
does it to remove the current node from the hierarchy such that the includes appear to happen on the parent rather than the current node. As a consequence, includeOverrides
must be used from the top level when it should be able to override registrations from foreign packages.
orderedselect_input.js
plays together with a corresponding template. What I would like it to use both from z3c.form
if its version has the JS file -- but I fear that the ZCML condition support does not support this. Renaming the JS file would mean that the corresponding template must be used - decoupling from possible related improvements in z3c.form
.
I likely will make a new dm.zope.profile
release which targets newer z3c.form
versions (those with a fixed template). People using an older z3c.form
must than use the current release.
Thanks for the includeOverrides explanation. That makes much sense. So it's hard to override without tight control of zcml loading order.
Regarding zcml conditions - we can only use provides
and installed
. For provides we'd need z3c.form to provide something via e.g. `<meta:provides feature="something" />
, which it apparently doesn't (grepping for meta.provides in z3c.form).
I like the idea of a release targeting a specific z3c.form version. That sounds good.
It seems the orderedselect_input.js
is registered as browser resource since move js to separate file to prevent escaped entities in Plone 5 · zopefoundation/z3c.form@6aade69 · GitHub or z3c.form 3.2.2
Looking at the (source code) documentation in preparing the new release I found out, that
my (quoted) analysis has been wrong: dm.zope.profile
never introduced orderedselect_input.js
, it has always used that provided by z3c.form
but it reregistered it globally while modern z3c.form
versions (apparently >=3.4
) register it only for the IFormLayer
.
Your error message indicates that you are using z3c.form==3.7.1
; nevertheless its orderedselect_input.js
registration seems to lack the layer specification. With such a specification, the registration would not conflict with that of dm.zope.profile
because the layer is part of the "discriminator".
I checked proper functioning of dm.zope.profile
with z3c.form==4.1.2
. Maybe, you can upgrade your z3c.form
version and check whether the problem disappears.