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
Save Image or File schema at Dexterity control panel
Edit and save existing image or file content again.
Errors should look like this:
Traceback (innermost last):
Module ZPublisher.WSGIPublisher, line 162, in transaction_pubevents
Module ZPublisher.WSGIPublisher, line 371, in publish_module
Module ZPublisher.WSGIPublisher, line 266, in publish
Module ZPublisher.mapply, line 85, in mapply
Module ZPublisher.WSGIPublisher, line 63, in call_object
Module plone.z3cform.layout, line 63, in __call__
Module plone.z3cform.layout, line 47, in update
Module plone.dexterity.browser.edit, line 58, in update
Module plone.z3cform.fieldsets.extensible, line 65, in update
Module plone.z3cform.patch, line 30, in GroupForm_update
Module z3c.form.group, line 145, in update
Module plone.app.z3cform.csrf, line 22, in execute
Module z3c.form.action, line 98, in execute
Module z3c.form.button, line 315, in __call__
Module z3c.form.button, line 170, in __call__
Module plone.dexterity.browser.edit, line 30, in handleApply
Module z3c.form.group, line 124, in applyChanges
Module zope.event, line 32, in notify
Module zope.component.event, line 27, in dispatch
Module zope.component._api, line 134, in subscribers
Module zope.interface.registry, line 448, in subscribers
Module zope.interface.adapter, line 619, in subscribers
Module zope.component.event, line 36, in objectEventNotify
Module zope.component._api, line 134, in subscribers
Module zope.interface.registry, line 448, in subscribers
Module zope.interface.adapter, line 619, in subscribers
Module plone.app.versioningbehavior.subscribers, line 62, in create_version_on_save
Module Products.CMFEditions.CopyModifyMergeRepositoryTool, line 332, in save
Module Products.CMFEditions.CopyModifyMergeRepositoryTool, line 500, in _recursiveSave
Module Products.CMFEditions.ArchivistTool, line 267, in prepare
Module Products.CMFEditions.ModifierRegistryTool, line 135, in getReferencedAttributes
Module plone.app.versioningbehavior.modifiers, line 117, in getReferencedAttributes
Module Products.CMFEditions.CopyModifyMergeRepositoryTool, line 410, in retrieve
Module Products.CMFEditions.CopyModifyMergeRepositoryTool, line 558, in _retrieve
Module Products.CMFEditions.CopyModifyMergeRepositoryTool, line 634, in _recursiveRetrieve
Module Products.CMFEditions.ArchivistTool, line 342, in retrieve
Module Products.CMFEditions.ArchivistTool, line 510, in __getitem__
Module Products.CMFEditions.ModifierRegistryTool, line 162, in reattachReferencedAttributes
Module plone.app.versioningbehavior.modifiers, line 188, in reattachReferencedAttributes
TypeError: ('Could not adapt', <Image at example.png>, <InterfaceClass plone.dexterity.schema.generated.Plone_5_1619726225_2_939166_0_Image>)
Schema identifiers are saved with separately saved attributes (as strings) to make it possibly to retrieve and use the schema to properly set the attribute back to cloned object. Saving a new version probably needs to wake up the previous version for reason or another, and because the woken gets the current dynamic schema version, it cannot adapt to the version retrieved with the old name.
Really need to write a test for this first to prevent further regression.
That aside, I wonder, if 'plone.dexterity.schema.generated.Plone_5_1619723628_2_8913827_0_File' is a clear pattern enough that if iface name starts with plone.dexterity.schema.generated. we could simply get the content type name after _0_ and use SCHEMA_CACHE.get() instead of resolveDottedName.
It seems that fix for plone/plone.dexterity#136 in plone/plone.dexterity@8fd6060 broke editing of versioned instances of File and Image content type (and other using the same plone.app.versioningbehavior modifiers).
How to reproduce:
Errors should look like this:
Schema identifiers are saved with separately saved attributes (as strings) to make it possibly to retrieve and use the schema to properly set the attribute back to cloned object. Saving a new version probably needs to wake up the previous version for reason or another, and because the woken gets the current dynamic schema version, it cannot adapt to the version retrieved with the old name.
https://community.plone.org/t/could-not-adapt-error-on-select-file-objects-with-versioning-enabled/13754/13
The text was updated successfully, but these errors were encountered: