Commit 7281da24 authored by Yusei Tahara's avatar Yusei Tahara

Fixed infinite loop bug.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@24328 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 3f0bd42e
...@@ -336,10 +336,18 @@ class TransformTool(UniqueObject, ActionProviderBase, Folder): ...@@ -336,10 +336,18 @@ class TransformTool(UniqueObject, ActionProviderBase, Folder):
return winner return winner
def _getPaths(self, orig, target, requirements, path=None, result=None): def _getPaths(self, orig, target, requirements, path=None, result=None, searched_orig_list=None):
"""return a all path for transformation from orig mimetype to """return a all path for transformation from orig mimetype to
target mimetype target mimetype
""" """
# don't search the same orig again, otherwise infinite loop occurs.
if searched_orig_list is None:
searched_orig_list = []
if orig in searched_orig_list:
return result
else:
searched_orig_list.append(orig)
if path is None: if path is None:
result = [] result = []
path = [] path = []
...@@ -363,7 +371,7 @@ class TransformTool(UniqueObject, ActionProviderBase, Folder): ...@@ -363,7 +371,7 @@ class TransformTool(UniqueObject, ActionProviderBase, Folder):
if not requirements: if not requirements:
result.append(path[:]) result.append(path[:])
else: else:
self._getPaths(o_mt, target, requirements, path, result) self._getPaths(o_mt, target, requirements, path, result, searched_orig_list)
if required: if required:
requirements.append(name) requirements.append(name)
path.pop() path.pop()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment