Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix use in Plone 4.3 with dexterity but without z3c.relationfield. #33

Merged
merged 1 commit into from
Jul 15, 2021

Conversation

mauritsvanrees
Copy link
Member

You get this for example in Plone 4.3 with only collective.easyform.
Partial traceback when visiting the export-content page:

  Module collective.exportimport.export_content, line 218, in portal_types
AttributeError: 'NoneType' object has no attribute 'providedBy'

That is this line.

Also, registered the relationvalue_converter_uuid serializer/adapter. It had an @adapter and @implementer but no zcml was registering it.

You get this for example in Plone 4.3 with only collective.easyform.

Also, registered the relationvalue_converter_uuid serializer/adapter.
@mauritsvanrees mauritsvanrees added the bug Something isn't working label Jul 8, 2021
@pbauer pbauer merged commit 5f0deaa into main Jul 15, 2021
@pbauer pbauer deleted the maurits/more-dexterity-and-relations-conditional branch July 15, 2021 09:35
@thomasmassmann
Copy link
Member

@mauritsvanrees, your change might pass all tests, but I’m not able to start Plone anymore because of a conflicting configuration:

Traceback (most recent call last):
  File "/Volumes/Work/Projects/collective.exportimport/parts/instance/bin/interpreter", line 278, in <module>
    exec(compile(__file__f.read(), __file__, "exec"))
  File "/Volumes/Work/Configurations/buildout/shared-eggs/Zope-4.5.5-py3.7.egg/Zope2/Startup/serve.py", line 255, in <module>
    sys.exit(main() or 0)
  File "/Volumes/Work/Configurations/buildout/shared-eggs/Zope-4.5.5-py3.7.egg/Zope2/Startup/serve.py", line 251, in main
    return command.run()
  File "/Volumes/Work/Configurations/buildout/shared-eggs/Zope-4.5.5-py3.7.egg/Zope2/Startup/serve.py", line 190, in run
    global_conf=vars)
  File "/Volumes/Work/Configurations/buildout/shared-eggs/Zope-4.5.5-py3.7.egg/Zope2/Startup/serve.py", line 220, in loadapp
    return loadapp(app_spec, name=name, relative_to=relative_to, **kw)
  File "/Volumes/Work/Configurations/buildout/shared-eggs/PasteDeploy-2.1.1-py3.7.egg/paste/deploy/loadwsgi.py", line 253, in loadapp
    return loadobj(APP, uri, name=name, **kw)
  File "/Volumes/Work/Configurations/buildout/shared-eggs/PasteDeploy-2.1.1-py3.7.egg/paste/deploy/loadwsgi.py", line 278, in loadobj
    return context.create()
  File "/Volumes/Work/Configurations/buildout/shared-eggs/PasteDeploy-2.1.1-py3.7.egg/paste/deploy/loadwsgi.py", line 715, in create
    return self.object_type.invoke(self)
  File "/Volumes/Work/Configurations/buildout/shared-eggs/PasteDeploy-2.1.1-py3.7.egg/paste/deploy/loadwsgi.py", line 209, in invoke
    app = context.app_context.create()
  File "/Volumes/Work/Configurations/buildout/shared-eggs/PasteDeploy-2.1.1-py3.7.egg/paste/deploy/loadwsgi.py", line 715, in create
    return self.object_type.invoke(self)
  File "/Volumes/Work/Configurations/buildout/shared-eggs/PasteDeploy-2.1.1-py3.7.egg/paste/deploy/loadwsgi.py", line 152, in invoke
    return fix_call(context.object, context.global_conf, **context.local_conf)
  File "/Volumes/Work/Configurations/buildout/shared-eggs/PasteDeploy-2.1.1-py3.7.egg/paste/deploy/util.py", line 55, in fix_call
    val = callable(*args, **kw)
  File "/Volumes/Work/Configurations/buildout/shared-eggs/Zope-4.5.5-py3.7.egg/Zope2/Startup/run.py", line 71, in make_wsgi_app
    starter.prepare()
  File "/Volumes/Work/Configurations/buildout/shared-eggs/Zope-4.5.5-py3.7.egg/Zope2/Startup/starter.py", line 41, in prepare
    self.startZope()
  File "/Volumes/Work/Configurations/buildout/shared-eggs/Zope-4.5.5-py3.7.egg/Zope2/Startup/starter.py", line 99, in startZope
    Zope2.startup_wsgi()
  File "/Volumes/Work/Configurations/buildout/shared-eggs/Zope-4.5.5-py3.7.egg/Zope2/__init__.py", line 50, in startup_wsgi
    _startup()
  File "/Volumes/Work/Configurations/buildout/shared-eggs/Zope-4.5.5-py3.7.egg/Zope2/App/startup.py", line 143, in startup
    load_zcml()
  File "/Volumes/Work/Configurations/buildout/shared-eggs/Zope-4.5.5-py3.7.egg/Zope2/App/startup.py", line 58, in load_zcml
    load_site()
  File "/Volumes/Work/Configurations/buildout/shared-eggs/Zope-4.5.5-py3.7.egg/Zope2/App/zcml.py", line 45, in load_site
    _context = xmlconfig.file(site_zcml)
  File "/Volumes/Work/Configurations/buildout/shared-eggs/zope.configuration-4.4.0-py3.7.egg/zope/configuration/xmlconfig.py", line 659, in file
    context.execute_actions()
  File "/Volumes/Work/Configurations/buildout/shared-eggs/zope.configuration-4.4.0-py3.7.egg/zope/configuration/config.py", line 784, in execute_actions
    for action in resolveConflicts(self.actions):
  File "/Volumes/Work/Configurations/buildout/shared-eggs/zope.configuration-4.4.0-py3.7.egg/zope/configuration/config.py", line 1811, in resolveConflicts
    raise ConfigurationConflictError(conflicts)
zope.configuration.config.ConfigurationConflictError: Conflicting configuration actions
  For: ('adapter', (<InterfaceClass z3c.relationfield.interfaces.IRelationValue>,), <InterfaceClass plone.restapi.interfaces.IJsonCompatible>, '')
    File "/Volumes/Work/Configurations/buildout/shared-eggs/plone.restapi-7.0.0-py3.7.egg/plone/restapi/serializer/configure.zcml", line 84.8-84.68
              <adapter factory=".relationfield.relationvalue_converter" />
    File "/Volumes/Work/Projects/collective.exportimport/src/collective/exportimport/configure.zcml", line 98.2-99.63
        <adapter zcml:condition="installed z3c.relationfield"
            factory=".export_content.relationvalue_converter_uuid" />

Running the test on my local machine does not throw the error:

  plone43-py27: commands succeeded
  plone50-py27: commands succeeded
  plone51-py27: commands succeeded
  plone52-py27: commands succeeded
ERROR:  plone52-py36: InterpreterNotFound: python3.6
  plone52-py37: commands succeeded
ERROR:  plone52-py38: InterpreterNotFound: python3.8

But starting the instance fails.

The conflicting config from plone.restapi was added a long time ago: plone/plone.restapi@bc48d60

Can you reproduce this?

@thomasmassmann
Copy link
Member

Including plone.restapi via ZCML fixes this:

iff --git a/src/collective/exportimport/configure.zcml b/src/collective/exportimport/configure.zcml
index ce5fa2c..046ddec 100644
--- a/src/collective/exportimport/configure.zcml
+++ b/src/collective/exportimport/configure.zcml
@@ -9,6 +9,7 @@
 
   <i18n:registerTranslations directory="locales" />
   <include package="Products.CMFCore" />
+  <include package="plone.restapi" />
 
   <!-- Exports -->
   <browser:page

@pbauer
Copy link
Member

pbauer commented Jul 21, 2021

I removed the serializer relationvalue_converter_uuid in 763c3a8 that created the conflict. Relations are dropped anyway in update_data_for_migration when exporting using the default-setting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants