Ticket #11887 (reopened Bug)
Versioning does not work for fields using AnnotationStorage on folderish types
Reported by: | frisi | Owned by: | alecm |
---|---|---|---|
Priority: | major | Milestone: | 4.x |
Component: | Versioning | Version: | 4.1 |
Keywords: | Cc: | alecm |
Description
For types that subclass Products.ATContentTypes.content.folder.ATFolder the versions view (@@history) does show a "There are no changes between the selected revisions." message although field values have been changed. Changes are shown for fields using AttributeStorage, but not for fields using AnnotationStorage (which ZopeSkel is using for title and description by default)
according to alec
"The issue stems from the fact that with the introduction of plone.folder in 4.0, folder ordering metadata is stored in annotations. That means that the OMOutsideChildrensModfier, which tries to preserve the contents of a folder on revert, preserves the annotations as well."
To prove this i modified the settings in portal_modifier mo my type is excluded by the modifier that handles folderish types and handled by the one for non-folderish types:
OMInsideChildrensModifier: python: portal_type == 'Project Reference' or (object and path("object/isPrincipiaFolderish|nothing") and not path("object/@@plone/isStructuralFolder|nothing")) OMOutsideChildrensModifier python:path('object/@@plone/isStructuralFolder|nothing') and portal_type != 'Project Reference' or portal_type == 'Folder'
With these changes all fields get versioned properly, but also the content of the folder gets reverted in case we switch to an earlier version.
Currently the way the modifier architecture is setup, it's primarily geared toward retrieving or preserving specific attributes (e.g. the annotations attribute), rather than sub-elements of those attributes, so the entire annotation storage is left intact in order to preserve the folder ordering on retrieve/revert.
This needs to be re-factored in a way that allows to keep the ordering of the folder, but revert other attributes.
Since most developers do use AnnotationStorage for all fields (Zopskel and Martin's book suggest to use it for title and description too) I'd consider this a major issue.
Change History
comment:2 Changed 3 years ago by eleddy
- Status changed from confirmed to closed
- Resolution set to wontfix
This ticket has not been modified in over 9 months. In another brazen attempt to clean this tracker up, this is closed. If you really, REALLY care about this ticket, please re-verify that it is still an issue on the current supported releases (4.2 or 4.3) and reopen. Better yet, submit a pull request to fix the bug and then close the bug properly. We <3 you and all of your effort, but we can't go on like this anymore. I hope you aren't too mad and we can still be friends. Hugs.