Commit 32da5a93 authored by Bartek Górny's avatar Bartek Górny

fixed getLatestVersionValue method

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@14774 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 6f3aa312
......@@ -662,9 +662,6 @@ class Document(XMLObject, UrlMixIn, ConversionCacheMixin, SnapshotMixin):
first = res[0]
in_original = None
for ob in res:
if ob.getLanguage() == original_language:
# this is in original language
in_original = ob
if ob.getVersion() != first.getVersion():
# we are out of the latest version - return in_original or first
if in_original is not None:
......@@ -674,6 +671,9 @@ class Document(XMLObject, UrlMixIn, ConversionCacheMixin, SnapshotMixin):
if ob.getLanguage() == user_language:
# we found it in the user language
return ob.getObject()
if ob.getLanguage() == original_language:
# this is in original language
in_original = ob
# this is the only doc in this version
return self
......
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