Created
October 9, 2017 19:02
-
-
Save rafaehlers/fd24f3c90dffa3665a3df56c4581df1a to your computer and use it in GitHub Desktop.
Fix this GF issue: https://github.com/gravityforms/gravityforms/commit/9d37fee852fe9946f030938bfa231e762f687728
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'gform_is_value_match', function( $is_match, $field_value, $target_value, $operation, $source_field, $rule ) { | |
/** | |
* Fix this issue for dates temporarily: | |
* https://github.com/gravityforms/gravityforms/commit/9d37fee852fe9946f030938bfa231e762f687728#commitcomment-23642339 | |
*/ | |
if ( ! $is_match && is_string( $field_value ) && is_string( $target_value ) ) { | |
switch ( $operation ): | |
case '>': return $field_value > $target_value; | |
case '<': return $field_value < $target_value; | |
endswitch; | |
} | |
return $is_match; | |
}, 10, 6 ); |
A fix before we figure out what's wrong. Then back to the original one (in GV 2.1).
<?php
add_filter( 'gform_is_value_match', function( $is_match, $field_value, $target_value, $operation, $source_field, $rule ) {
if ( is_array( $field_value ) && count( $field_value ) == 1 && ! is_array( $target_value ) ) {
$field_value = array_pop( $field_value );
}
/**
* Fix this issue for dates temporarily:
* https://github.com/gravityforms/gravityforms/commit/9d37fee852fe9946f030938bfa231e762f687728#commitcomment-23642339
*/
if ( ! $is_match && is_string( $field_value ) && is_string( $target_value ) ) {
switch ( $operation ):
case '>': return $field_value > $target_value;
case '<': return $field_value < $target_value;
endswitch;
}
return $is_match;
}, 10, 6 );
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Stopped working after v2.0.14 GravityKit/GravityView@d09b3bc