Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Tatuya Kamada
erp5
Commits
f2eb310c
Commit
f2eb310c
authored
May 06, 2011
by
Vincent Pelletier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Patch OFS.History.
parent
7e76a151
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
46 additions
and
0 deletions
+46
-0
product/ERP5Type/ZopePatch.py
product/ERP5Type/ZopePatch.py
+1
-0
product/ERP5Type/patches/OFSHistory.py
product/ERP5Type/patches/OFSHistory.py
+45
-0
No files found.
product/ERP5Type/ZopePatch.py
View file @
f2eb310c
...
...
@@ -72,6 +72,7 @@ from Products.ERP5Type.patches import ZODBConnection
from
Products.ERP5Type.patches
import
TransactionAddBeforeCommitHook
from
Products.ERP5Type.patches
import
ZopePageTemplate
from
Products.ERP5Type.patches
import
ZopePageTemplateUtils
from
Products.ERP5Type.patches
import
OFSHistory
# These symbols are required for backward compatibility
from
Products.ERP5Type.patches.PropertyManager
import
ERP5PropertyManager
...
...
product/ERP5Type/patches/OFSHistory.py
0 → 100644
View file @
f2eb310c
##############################################################################
#
# Copyright (c) 2002 Zope Foundation and Contributors.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE
#
##############################################################################
from
OFS.History
import
HystoryJar
,
historicalRevision
"""
Rationale for this patch:
Modifications __setstate__ does to self must not cause object to become
registered to its jar (ie, it must have no jar).
Original code breaks this, and this makes it impossible to view, for example,
a former revision of a PythonScript if that revision was written by an old
Zope (ex: 2.12 reading 2.8 PythonScript).
Launchpad bug opened, patch submitted:
https://bugs.launchpad.net/zope2/+bug/735999
"""
# Original function lines removed by this patch are present but commented-out.
def
patched_historicalRevision
(
self
,
serial
):
state
=
self
.
_p_jar
.
oldstate
(
self
,
serial
)
rev
=
self
.
__class__
.
__basicnew__
()
# rev._p_jar=HystoryJar(self._p_jar)
rev
.
_p_oid
=
self
.
_p_oid
# rev._p_serial=serial
rev
.
__setstate__
(
state
)
# rev._p_changed=0
# PATCH ADDITION BEGIN
rev
.
_p_serial
=
serial
rev
.
_p_jar
=
HystoryJar
(
self
.
_p_jar
)
# PATCH ADDITION END
return
rev
historicalRevision
.
func_code
=
patched_historicalRevision
.
func_code
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment