MDL-26177 fix non-working unique custom field check