From: Joe Hunt Date: Tue, 23 Mar 2010 15:17:36 +0000 (+0000) Subject: problem with "00" == "0" in php. X-Git-Tag: v2.4.2~19^2~931 X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=commitdiff_plain;h=803468dd5b0bb8d84f5366b6465203df12323c99;p=fa-stable.git problem with "00" == "0" in php. --- diff --git a/CHANGELOG.txt b/CHANGELOG.txt index e359a981..f5adff05 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -20,7 +20,8 @@ Legend: $ -> Affected files 22-Mar-2010 Joe Hunt -# Error editing (updating) Account Groups +# Error editing (updating) Account Groups and problem + with "00" == "0" in php. $ /gl/includes/db/gl_db_account_types.inc /gl/manage/gl_account_classes.php /gl/manage/gl_account_types.php diff --git a/gl/manage/gl_account_types.php b/gl/manage/gl_account_types.php index 6fbb9df5..628cbc2f 100644 --- a/gl/manage/gl_account_types.php +++ b/gl/manage/gl_account_types.php @@ -26,12 +26,12 @@ function can_process() { global $selected_id; - /*if (!input_num('id')) + if ($_POST['id'] == "") { - display_error( _("The account id must be an integer and cannot be empty.")); + display_error( _("The account group id cannot be empty.")); set_focus('id'); return false; - }*/ + } if (strlen($_POST['name']) == 0) { display_error( _("The account group name cannot be empty.")); @@ -39,9 +39,10 @@ function can_process() return false; } - if (isset($selected_id) && ($selected_id == $_POST['parent'])) + if (strcmp($_POST['id'], $_POST['parent']) == 0) { - display_error(_("You cannot set an account group to be a subgroup of itself.")); + display_error("id = {$_POST['id']}, parent = {$_POST['parent']}"); + //display_error(_("You cannot set an account group to be a subgroup of itself.")); return false; } @@ -184,7 +185,7 @@ class_list_row(_("Class Type:"), 'class_id', null); end_table(1); -submit_add_or_update_center($selected_id == -1, '', 'both'); +submit_add_or_update_center($selected_id == "", '', 'both'); end_form();