[Transmogrifier] transmogrifier.registerConfig with dotted name as "name parameter

Trying to use/port transmogrifier to Python 3/Plone 5.2...

Under Python 3/Plone 5.2 I get the following error from a configuration like

  <transmogrifier:registerConfig
      name="ugent.import_content"
      title="ugent.plone5migration (import)"
      description="This pipeline imports content into a Plone site"
      configuration="import_content.cfg"
      />

  File "/home/ajung/sandboxes/ugent-portaal-plone-4x/eggs/zope.schema-4.9.3-py3.6.egg/zope/schema/_field.py", line 544, in fromUnicode
    self.validate(v)
  File "/home/ajung/sandboxes/ugent-portaal-plone-4x/eggs/zope.schema-4.9.3-py3.6.egg/zope/schema/_bootstrapfields.py", line 291, in validate
    self._validate(value)
  File "/home/ajung/sandboxes/ugent-portaal-plone-4x/eggs/zope.configuration-4.3.1-py3.6.egg/zope/configuration/fields.py", line 89, in _validate
    super(PythonIdentifier, self)._validate(value)
  File "/home/ajung/sandboxes/ugent-portaal-plone-4x/eggs/zope.schema-4.9.3-py3.6.egg/zope/schema/_field.py", line 625, in _validate
    raise InvalidValue(value).with_field_and_value(self, value)
zope.configuration.exceptions.ConfigurationError: Invalid value for 'name'
    File "/home/ajung/sandboxes/ugent-portaal-plone-4x/parts/instance/etc/site.zcml", line 16.2-16.23
    File "/home/ajung/sandboxes/ugent-portaal-plone-4x/eggs/Products.CMFPlone-5.2rc2-py3.6.egg/Products/CMFPlone/configure.zcml", line 110.2-114.8
    File "/home/ajung/sandboxes/ugent-portaal-plone-4x/src/ugent.plone5migration/src/ugent/plone5migration/configure.zcml", line 10.2-10.31
    File "/home/ajung/sandboxes/ugent-portaal-plone-4x/src/ugent.plone5migration/src/ugent/plone5migration/import/configure.zcml", line 10.2-15.8
    zope.schema._bootstrapinterfaces.InvalidValue: ugent.import_content

The name parameter is defined as a zope.configuration.field.PythonIdentifier.

The validator (a regex) for PythonIdentifier does not allow dotted names.

I wonder why a dotted name was used and worked under older Plone versions?

I found the same issue when trying to setup transmogrifier for python3 and found the following:

collective.transmogrifier imports the PythonIdentifier class from zope.configuration.fields, which in previous versions of zope.configuration (such as 3.7.4 in case of Plone 5.1.x), had its definition and a regex like this:

The zope.configuration package present in Plone 5.2.x imports PythonIdentifier from zope.schema which has a diferent regex:

Finally I ended using the REST API to do the migration.

zope.configuration backward compatibility foul :crying_cat_face:

Related