Skip to content

Commit

Permalink
Fixed issue Other comment mandatory requires 2 or more characters in …
Browse files Browse the repository at this point in the history
…comment field instead of 1 or more characters
  • Loading branch information
TMSWhite committed Jul 16, 2012
1 parent 199f26b commit c34e5cc
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions classes/expressions/LimeExpressionManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -2123,13 +2123,12 @@ public function _CreateSubQLevelRelevanceAndValidationEqns($onlyThisQseq=NULL)
$sgqa = $qinfo['sgqa'];
switch ($type)
{
// TODO oddly, the other field has value of 0 when empty instead of "", so cheating and looking for strlen > 1
case '!': //List - dropdown
case 'L': //LIST drop-down/radio-button list
$eqn = "(" . $sgqa . ".NAOK!='-oth-' || (" . $sgqa . ".NAOK=='-oth-' && strlen(trim(" . $sgqa . "other.NAOK))>1))";
$eqn = "(" . $sgqa . ".NAOK!='-oth-' || (" . $sgqa . ".NAOK=='-oth-' && !is_empty(trim(" . $sgqa . "other.NAOK))))";
break;
case 'P': //Multiple choice with comments checkbox + text
$eqn = "(is_empty(trim(" . $sgqa . "other.NAOK)) || (!is_empty(trim(" . $sgqa . "other.NAOK)) && strlen(trim(" . $sgqa . "othercomment.NAOK))>1))";
$eqn = "(is_empty(trim(" . $sgqa . "other.NAOK)) || (!is_empty(trim(" . $sgqa . "other.NAOK)) && !is_empty(trim(" . $sgqa . "othercomment.NAOK))))";
break;
default:
break;
Expand Down

0 comments on commit c34e5cc

Please sign in to comment.