Viewing 8 replies - 1 through 8 (of 8 total)
  • Thread Starter gunnyst

    (@gunnyst)

    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,
    Plugin Author doublesharp

    (@doublesharp)

    Thanks! I’ll see if I can get it merged into the next version. Would you be able to test it out as I don’t have any WPML sites?

    It’s not easy to share with the WordPress svn repo, so i might set up a github repo as well for pull requests like these. I’ll post the info if I do.

    Thanks also for catching the email issue… Not sure what went wrong but it should be working now (if you used info@doublesharp).

    Thread Starter gunnyst

    (@gunnyst)

    Hi!

    Sure, just let me know and I’ll test it. Btw. I sent you an email as well (and didn’t get an error back this time), so you can update me that way. Whatever is more convenient to you.

    Cheers

    Günther

    Plugin Author doublesharp

    (@doublesharp)

    Hi Günther,

    Finally got a chance to merge your code. Some other changes had been made to the plugin as well, so I had to modify your code a bit. I was able to test the non-WPML version just passing array( (int) $post_id ) which works, so I suspect the WPML version will as well. The other change I made was to pass the NOT IN values through $wpml->prepare() via call_user_func_array(). Please let me know how it works for you.

    Thread Starter gunnyst

    (@gunnyst)

    Hi Justin,

    on little issue on line 330 – you’ll have to change:

    $post_ids = implode( ',', array_unique( $wpml_ids ) );

    to

    $post_ids = array_unique( $wpml_ids );

    now I’ll give it a try and let you know!

    Cheers

    Günther

    Plugin Author doublesharp

    (@doublesharp)

    This is resolved in the master build on GitHub: https://github.com/doublesharp/validated-field-for-acf/archive/master.zip

    Marking resolved as a new version is imminent.

    Plugin Author doublesharp

    (@doublesharp)

    @gunnyst can you please validate that Validated Field 3.4 Beta is compatible with WPML? Thanks!

    Thread Starter gunnyst

    (@gunnyst)

    Hi Justin, currently I’m no longer working on the site where I had this running together with WPML, so I’m now unable to test this in any useful manner. But maybe someone else can jump in? I do guess WPML is quite wide-spread…

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘WPML support’ is closed to new replies.