Commit 47aac7cd authored by Sebastien Robin's avatar Sebastien Robin

corrected problems with catalog


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@1390 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 63f67fb7
...@@ -43,7 +43,7 @@ def checkSameKeys(a , b): ...@@ -43,7 +43,7 @@ def checkSameKeys(a , b):
def getOrderedUids(uids, values, catalog_index): def getOrderedUids(uids, values, catalog_index):
value_to_uid = {} value_to_uid = {}
for uid in uids: for uid in uids:
key = context.portal_catalog.getMetadataForUid(uid)[catalog_index] key = context.portal_catalog(uid=uid)[0].getObject().getProperty(catalog_index)
value_to_uid[key] = uid value_to_uid[key] = uid
uids = [] uids = []
for value in values: for value in values:
...@@ -75,6 +75,11 @@ try: ...@@ -75,6 +75,11 @@ try:
new_value = v new_value = v
base_category = f.get_value( 'base_category') base_category = f.get_value( 'base_category')
if my_field and base_category is not None: if my_field and base_category is not None:
empty_list = 0
if new_value == '':
new_value = []
if same_type(new_value,'a'):
new_value = [new_value]
same_keys = 0 same_keys = 0
if my_field.meta_type == 'MultiRelationStringField': if my_field.meta_type == 'MultiRelationStringField':
# The checkProperty sometimes does not provide an # The checkProperty sometimes does not provide an
......
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