I just got an error message back from your info-email-address….. here is a copy & paste version of the DIFF
213c213
<
---
>
217,228d216
<
< // get code list of active languages
< if (function_exists('icl_object_id')) {
< $languages = $wpdb->get_results("SELECT code FROM {$wpdb->prefix}icl_languages WHERE active = 1", ARRAY_A);
< $wpml_ids = array();
< foreach($languages as $lang)
< $wpml_ids[] = (int)icl_object_id($post_id, $post_type, true, $lang['code']);
< $post_ids = implode(",", array_unique($wpml_ids));
< } else {
< $post_ids = (int)$post_id;
< }
<
231c219
< switch ( $unique ) {
---
> switch ( $unique ){
235c223,224
< "{$sql_prefix} AND post_id NOT IN ({$post_ids}) WHERE meta_value = %s",
---
> "{$sql_prefix} AND post_id != %d WHERE meta_value = %s",
> $post_id,
242c231
< "{$sql_prefix} AND p.post_type = %s AND post_id NOT IN ({$post_ids}) WHERE meta_value = %s",
---
> "{$sql_prefix} AND p.post_type = %s AND post_id != %d WHERE meta_value = %s",
243a233
> $post_id,
251a242
> $sql = "{$sql_prefix} AND p.post_type = %s WHERE ( ( post_id = %d AND meta_key != %s AND meta_key LIKE %s ) OR ( post_id != %d AND meta_key LIKE %s ) ) AND meta_value = %s";
253c244
< "{$sql_prefix} AND p.post_type = %s WHERE ( ( post_id = %d AND meta_key != %s AND meta_key LIKE %s ) OR ( post_id NOT IN ({$post_ids}) AND meta_key LIKE %s ) ) AND meta_value = %s",
---
> "{$sql_prefix} AND p.post_type = %s WHERE ( ( post_id = %d AND meta_key != %s AND meta_key LIKE %s ) OR ( post_id != %d AND meta_key LIKE %s ) ) AND meta_value = %s",
257a249
> $post_id,
263c255
< "{$sql_prefix} AND p.post_type = %s AND post_id NOT IN ({$post_ids}) WHERE meta_key = %s AND meta_value = %s",
---
> "{$sql_prefix} AND p.post_type = %s AND post_id != %d WHERE meta_key = %s AND meta_value = %s",
264a257
> $post_id,