You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add initial values for that same field in registry.xml
Install the product
You will see a traceback like this:
Traceback (innermost last):
Module ZPublisher.Publish, line 138, in publish
Module ZPublisher.mapply, line 77, in mapply
Module ZPublisher.Publish, line 48, in call_object
Module Products.CMFPlone.controlpanel.browser.quickinstaller, line 213, in __call__
Module <string>, line 3, in installProducts
Module AccessControl.requestmethod, line 70, in _curried
Module Products.CMFQuickInstallerTool.QuickInstallerTool, line 686, in installProducts
Module Products.CMFQuickInstallerTool.QuickInstallerTool, line 602, in installProduct
Module Products.GenericSetup.tool, line 388, in runAllImportStepsFromProfile
Module Products.GenericSetup.tool, line 1433, in _runImportStepsFromContext
Module Products.GenericSetup.tool, line 1245, in _doRunImportStep
Module plone.app.registry.exportimport.handler, line 70, in importRegistry
Module plone.app.registry.exportimport.handler, line 116, in importDocument
Module plone.app.registry.exportimport.handler, line 324, in importRecord
Module plone.registry.record, line 34, in __init__
ValueError: Field is not persistent
If the product was installed and the validator is added afterwards, when you try to reimport the registry.xml the traceback looks like this:
Traceback (innermost last):
Module ZPublisher.Publish, line 138, in publish
Module ZPublisher.mapply, line 77, in mapply
Module ZPublisher.Publish, line 48, in call_object
Module Products.GenericSetup.tool, line 559, in manage_importSelectedSteps
Module Products.GenericSetup.tool, line 358, in runImportStepFromProfile
Module Products.GenericSetup.tool, line 1245, in _doRunImportStep
Module plone.app.registry.exportimport.handler, line 70, in importRegistry
Module plone.app.registry.exportimport.handler, line 116, in importDocument
Module plone.app.registry.exportimport.handler, line 282, in importRecord
Module plone.registry.record, line 60, in _set_field
Module plone.registry.registry, line 283, in _setField
ValueError: The record's field must be an IPersistentField.
As I explain in my comment (collective/collective.z3cform.datagridfield#14 (comment)), I found that when the persistent field is created, the __provides__ attribute would be overridden. This only happens when the field has a custom validator defined.
In order to fix it, I have added the __provides__ to the list of ignored attributes by adding to my __init.py__:
from plone.registry.field import DisallowedProperty
DisallowedProperty('__provides__')
I found that the vocabulary attribute is already ignored in
Steps to reproduce:
You will see a traceback like this:
If the product was installed and the validator is added afterwards, when you try to reimport the registry.xml the traceback looks like this:
This is what happens in collective/collective.z3cform.datagridfield#14
As I explain in my comment (collective/collective.z3cform.datagridfield#14 (comment)), I found that when the persistent field is created, the
__provides__
attribute would be overridden. This only happens when the field has a custom validator defined.In order to fix it, I have added the
__provides__
to the list of ignored attributes by adding to my__init.py__
:I found that the vocabulary attribute is already ignored in
plone.registry/plone/registry/field.py
Line 280 in 4d03736
should I add the
__provides__
here as well as a solution?The text was updated successfully, but these errors were encountered: