Add fake former_dotted_names attribute #169
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I had a content history broken with the following traceback (it seems related to a BlobImage field changed between two versions):
Traceback (innermost last):
Module ZPublisher.WSGIPublisher, line 181, in transaction_pubevents
Module ZPublisher.WSGIPublisher, line 391, in publish_module
Module ZPublisher.WSGIPublisher, line 285, in publish
Module ZPublisher.mapply, line 98, in mapply
Module ZPublisher.WSGIPublisher, line 68, in call_object
Module zope.browserpage.simpleviewclass, line 44, in call
Module Products.Five.browser.pagetemplatefile, line 126, in call
Module Products.Five.browser.pagetemplatefile, line 58, in call
Module zope.pagetemplate.pagetemplate, line 134, in pt_render
Module Products.PageTemplates.engine, line 365, in call
Module z3c.pt.pagetemplate, line 174, in render
Module chameleon.zpt.template, line 331, in render
Module chameleon.template, line 217, in render
Module chameleon.utils, line 20, in raise_with_traceback
Module chameleon.template, line 193, in render
Module 780410a05053f34ef67569d9c06c72e2, line 2165, in render
Module 1adf066ef8359a909534e1a4aa4e8557, line 930, in render_master
Module 1adf066ef8359a909534e1a4aa4e8557, line 1590, in render_content
Module 780410a05053f34ef67569d9c06c72e2, line 1793, in __fill_main
Module zope.tales.pythonexpr, line 73, in call
Module , line 1, in
Module Products.CMFEditions.CopyModifyMergeRepositoryTool, line 376, in retrieve
Module Products.CMFEditions.CopyModifyMergeRepositoryTool, line 512, in _retrieve
Module Products.CMFEditions.CopyModifyMergeRepositoryTool, line 585, in _recursiveRetrieve
Module Products.CMFEditions.ArchivistTool, line 353, in retrieve
Module Products.CMFEditions.ArchivistTool, line 525, in getitem
Module Products.CMFEditions.ModifierRegistryTool, line 163, in reattachReferencedAttributes
Module plone.app.versioningbehavior.modifiers, line 140, in reattachReferencedAttributes
Module plone.behavior.registration, line 93, in lookup_behavior_registration
AttributeError: 'TaxonomyBehavior' object has no attribute 'former_dotted_names'
The problem is here: https://github.com/plone/plone.app.versioningbehavior/blob/master/plone/app/versioningbehavior/modifiers.py#L140
Where the method tries to check if there is a behavior with the name of the interface, and plone.behavior needs an attribute "former_dotted_names" for backward compatibility.
TaxononmyBehavior does not provide this attribute and the versioning get broken.
I added a new attribute that returns the behavior dotted name as fallback.