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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Matevz Golob
erp5
Commits
de1a71eb
Commit
de1a71eb
authored
Jul 08, 2011
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
TrashTool: do not backup broken objects due to a bug in ZODB.ExportImport
parent
dc11344d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
2 deletions
+11
-2
product/ERP5/Tool/TrashTool.py
product/ERP5/Tool/TrashTool.py
+11
-2
No files found.
product/ERP5/Tool/TrashTool.py
View file @
de1a71eb
...
@@ -28,6 +28,7 @@
...
@@ -28,6 +28,7 @@
from
AccessControl
import
ClassSecurityInfo
from
AccessControl
import
ClassSecurityInfo
from
ZODB.broken
import
Broken
from
Products.ERP5Type.Accessor.Constant
import
PropertyGetter
as
ConstantGetter
from
Products.ERP5Type.Accessor.Constant
import
PropertyGetter
as
ConstantGetter
from
Products.ERP5Type.Globals
import
InitializeClass
,
DTMLFile
from
Products.ERP5Type.Globals
import
InitializeClass
,
DTMLFile
from
Products.ERP5Type.Tool.BaseTool
import
BaseTool
from
Products.ERP5Type.Tool.BaseTool
import
BaseTool
...
@@ -89,9 +90,16 @@ class TrashTool(BaseTool):
...
@@ -89,9 +90,16 @@ class TrashTool(BaseTool):
o
=
o
.
aq_parent
o
=
o
.
aq_parent
connection
=
o
.
_p_jar
connection
=
o
.
_p_jar
if
obj
.
_p_oid
is
None
:
if
obj
.
_p_oid
is
None
:
LOG
(
"Trash Tool backupObject"
,
100
,
LOG
(
"Trash Tool backupObject"
,
WARNING
,
"Trying to backup uncommitted object %s"
%
object_path
)
"Trying to backup uncommitted object %s"
%
object_path
)
return
{}
return
{}
if
isinstance
(
obj
,
Broken
):
# Workaround for bug in ExportImport._importDuringCommit
# (ZODB.serialize should be reused in order
# to use appropriate class factory)
LOG
(
"Trash Tool backupObject"
,
WARNING
,
"Can't backup broken object %s"
%
object_path
)
return
{}
copy
=
connection
.
exportFile
(
obj
.
_p_oid
)
copy
=
connection
.
exportFile
(
obj
.
_p_oid
)
# import object in trash
# import object in trash
connection
=
backup_object_container
.
_p_jar
connection
=
backup_object_container
.
_p_jar
...
@@ -120,7 +128,8 @@ class TrashTool(BaseTool):
...
@@ -120,7 +128,8 @@ class TrashTool(BaseTool):
# field_added doesn't not exists on parent if it is a Trash
# field_added doesn't not exists on parent if it is a Trash
# Folder and not a Form, or a module for the old object is
# Folder and not a Form, or a module for the old object is
# already removed, and we cannot backup the object
# already removed, and we cannot backup the object
LOG
(
"Trash Tool backupObject"
,
100
,
"Can't backup object %s"
%
(
object_id
))
LOG
(
"Trash Tool backupObject"
,
WARNING
,
"Can't backup object %s"
%
object_path
)
return
{}
return
{}
keep_sub
=
kw
.
get
(
'keep_subobjects'
,
0
)
keep_sub
=
kw
.
get
(
'keep_subobjects'
,
0
)
...
...
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