Created
July 21, 2015 09:50
-
-
Save alpharder/a9b91b50c8a3c3e11850 to your computer and use it in GitHub Desktop.
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
diff --git a/app/functions/fn.common.php b/app/functions/fn.common.php | |
index 4bf36ce..7ccd1fb 100644 | |
--- a/app/functions/fn.common.php | |
+++ b/app/functions/fn.common.php | |
@@ -5877,7 +5877,7 @@ function fn_live_editor_prepare_callback_args($schema, $vars) | |
* @param $operator | |
* @param $right_operand | |
* | |
- * @return bool Comparison result | |
+ * @return bool|null Boolean comparison result or null if unknown operator given | |
*/ | |
function fn_compare_values_by_operator($left_operand, $operator, $right_operand) | |
{ | |
@@ -5943,9 +5943,9 @@ function fn_compare_values_by_operator($left_operand, $operator, $right_operand) | |
} else { | |
return !in_array($left_operand, $right_operand); | |
} | |
- } else { | |
- throw new InvalidArgumentException('Unknown operator given'); | |
} | |
+ | |
+ return null; | |
} | |
/** |
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
diff --git a/app/functions/fn.promotions.php b/app/functions/fn.promotions.php | |
index a67a7ea..a934b0c 100644 | |
--- a/app/functions/fn.promotions.php | |
+++ b/app/functions/fn.promotions.php | |
@@ -933,6 +933,11 @@ function fn_promotion_validate_attribute($value, $condition, $op) | |
fn_set_hook('pre_validate_promotion_attribute', $value, $condition, $op, $result); | |
+ // Modified at hook handler | |
+ if ($result) { | |
+ return true; | |
+ } | |
+ | |
$val = !is_array($value) ? array($value) : $value; | |
if ($op == 'neq') { |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment