Fix enumeration type custom column not being merged. Fixes #1061602 (User Defined metadata/Columns not merged.)

This commit is contained in:
Kovid Goyal 2012-10-05 16:20:51 +05:30
commit 32fd2bfbf2

View File

@ -459,9 +459,10 @@ class EditMetadataAction(InterfaceAction):
if src_value:
src_index = db.get_custom_extra(src_id, num=colnum, index_is_id=True)
db.set_custom(dest_id, src_value, num=colnum, extra=src_index)
if db.field_metadata[key]['datatype'] == 'text' \
and not db.field_metadata[key]['is_multiple'] \
and not dest_value:
if (db.field_metadata[key]['datatype'] == 'enumeration' or
(db.field_metadata[key]['datatype'] == 'text' and
not db.field_metadata[key]['is_multiple'])
and not dest_value):
db.set_custom(dest_id, src_value, num=colnum)
if db.field_metadata[key]['datatype'] == 'text' \
and db.field_metadata[key]['is_multiple']: