-
-
Notifications
You must be signed in to change notification settings - Fork 12
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
Allows versioning of the Plone Site type for the portal working copy to work #113
base: master
Are you sure you want to change the base?
Conversation
For the working copy of plone.app.iterate to work on the "Plone Site" type, it is necessary that this type is versionable. See: https://github.com/plone/plone.app.iterate/blob/1908aa1f4e9c95c37143fae88655469b72ea451a/plone/app/iterate/browser/control.py#L88-L90
Products.CMFEditions uses the pickle module to clone objects. See: https://github.com/plone/Products.CMFEditions/blob/c80bc31af46bff45fee2908878b1f01190fda8d8/Products/CMFEditions/ArchivistTool.py#L210-L229 These changes prevent the error: TypeError: Can't pickle objects in acquisition wrappers When trying to serialize an ImplicitAcquisitionWrapper object with the pickle dump. This error occurred when trying to check in a Plone Site type with plone.app.iterate. These changes also allow the Plone Site type to be serialized with the pickle.
@wesleybl thanks for creating this Pull Request and helping to improve Plone! TL;DR: Finish pushing changes, pass all other checks, then paste a comment:
To ensure that these changes do not break other parts of Plone, the Plone test suite matrix needs to pass, but it takes 30-60 min. Other CI checks are usually much faster and the Plone Jenkins resources are limited, so when done pushing changes and all other checks pass either start all Jenkins PR jobs yourself, or simply add the comment above in this PR to start all the jobs automatically. Happy hacking! |
@jenkins-plone-org please run jobs |
I ran the tests for this PR along with plone/plone.app.iterate#128 See: |
<type name="Plone Site"> | ||
<policy name="at_edit_autoversion" /> | ||
<policy name="version_on_revert" /> | ||
</type> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure whether I should do an upgrade step for this or just leave it for new portals.
This is part of: plone/volto#5284
For the working copy of
plone.app.iterate
to work on thePlone Site
type, it is necessary that this type is versionable. See:https://github.com/plone/plone.app.iterate/blob/1908aa1f4e9c95c37143fae88655469b72ea451a/plone/app/iterate/browser/control.py#L88-L90
This also allows the "Plone Site" type to be cloned.
Products.CMFEditions
uses thepickle
module to clone objects. See:Products.CMFEditions/Products/CMFEditions/ArchivistTool.py
Lines 210 to 229 in c80bc31
These changes prevent the error:
When trying to serialize an
ImplicitAcquisitionWrapper
object with the pickle dump. This error occurred when trying to check in a Plone Site type withplone.app.iterate
.These changes also allow the Plone Site type to be serialized with the pickle. When the
persistent_id
method ofSkipParentPointers
returns something other than None, the object is not serialized. So we need to make sure it returns None for the Plone Site type.