Commit 0956837c authored by Yusei Tahara's avatar Yusei Tahara

Remove duplicate entries from result.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@17991 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent da45995f
...@@ -517,9 +517,17 @@ class Document(XMLObject, UrlMixIn, ConversionCacheMixin, SnapshotMixin): ...@@ -517,9 +517,17 @@ class Document(XMLObject, UrlMixIn, ConversionCacheMixin, SnapshotMixin):
LOG('ERP5/Document/Document.getSearchableReferenceList', 0, LOG('ERP5/Document/Document.getSearchableReferenceList', 0,
'Document regular expression must be set in portal preferences') 'Document regular expression must be set in portal preferences')
return () return ()
res = rx_search.finditer(text) result = []
res = [(r.group(), r.groupdict()) for r in res] tmp = {}
return res for match in rx_search.finditer(text):
group = match.group()
group_item_list = match.groupdict().items()
group_item_list.sort()
key = (group, tuple(group_item_list))
tmp[key] = None
for group, group_item_tuple in tmp.keys():
result.append((group, dict(group_item_tuple)))
return result
security.declareProtected(Permissions.AccessContentsInformation, 'getImplicitSuccessorValueList') security.declareProtected(Permissions.AccessContentsInformation, 'getImplicitSuccessorValueList')
def getImplicitSuccessorValueList(self): def getImplicitSuccessorValueList(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