Menu ▾ ▴

#122 5dev37: No possible right answer in Contract Amount

open
nobody
Interface (34)
5
2005-02-11
2005-02-11
No

* When filling in a new group info, there is NO CORRECT
answer for the Contract Amount: field - you will ALWAYS
get an error message! That's due to a logic error in
modules/groups/actions/new.php in this code (fixed):
-------------------------------------------------------------
//fmg: logic error was on next line
if (empty($_POST['ContractAmount']) or
!ereg('[^0-9\.,]',$_POST['ContractAmount'])) {
$_ENV['api']['sys']->push_error(t("Please enter a
numerical value for contract amount."));
}//if empty or not a number
-------------------------------------------------------------

This is why I find the last line:

}//if empty or not a number

to be a life-saver in both PHP and Perl (but where # is
comment). It re-iterates for me what the original test
case was. In vertically-long routines, it also avoids
logic errors.

Cheers,
Fil

Discussion


Log in to post a comment.