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

Add fake former_dotted_names attribute #169

Merged
merged 1 commit into from
Nov 5, 2024
Merged

Conversation

cekk
Copy link
Contributor

@cekk cekk commented Nov 4, 2024

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

  • traceback_info: (pr.retrieve(context, version_id))
    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.

@cekk cekk requested review from petschki and mamico November 4, 2024 15:21
@petschki
Copy link
Member

petschki commented Nov 4, 2024

So this will fix #139 and plone/plone.behavior#23 right?

@cekk
Copy link
Contributor Author

cekk commented Nov 5, 2024

@petschki yes, it's exactly the same problem (i haven't checked opened issues, sorry).

@petschki
Copy link
Member

petschki commented Nov 5, 2024

Thank you!

@petschki petschki merged commit c6c15a3 into master Nov 5, 2024
8 checks passed
@petschki petschki deleted the former_dotted_names branch November 5, 2024 08:47
@petschki
Copy link
Member

petschki commented Nov 5, 2024

released 3.1.5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants