Skip to content

Commit

Permalink
Merge pull request #843 from marcosgdf/bug-828
Browse files Browse the repository at this point in the history
Fixed bug #828: Error when code_region is not a number in llx_c_regions ...
  • Loading branch information
eldy committed Apr 19, 2013
2 parents 50ec96d + becd40a commit de2a5a8
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 9 deletions.
3 changes: 2 additions & 1 deletion ChangeLog
Expand Up @@ -19,11 +19,12 @@ English Dolibarr ChangeLog
- Fix: [ bug #806 ] Margins module with orders2invoice does not respect cost price
- Fix: Orderstoinvoice didn't act as expected when no order was checked
- Fix: Bad link to all proposals into Third party card if customer is prospect
- Fix: [ bug #774 ] Bug on creating event with box "all day" crossed
- Fix: [ bug #789 ] VAT not being calculated in POS
- Fix: [ bug #794 ] Lost filter on zipcode in prospect list
- Fix: [ bug #774 ] Bug on creating event with box "all day" crossed
- Fix: [ bug #810 ] Cannot update ODT template path
- Fix: [ bug #824 ] MAIN_DB_PREFIX not use into dictionnary
- Fix: [ bug #828 ] Error when code_region is not a number in llx_c_regions (with postgres)


***** ChangeLog for 3.3.1 compared to 3.3 *****
Expand Down
26 changes: 18 additions & 8 deletions htdocs/admin/dict.php
Expand Up @@ -383,7 +383,7 @@

// Define localtax_typeList (used for dictionnary "c_tva")
$localtax_typeList = array();
if (GETPOST("id") == 10)
if ($id == 10)
{
$localtax_typeList = array(
"0" => $langs->trans("No"),
Expand Down Expand Up @@ -433,22 +433,32 @@
if ($fieldnamekey == 'position') $fieldnamekey = 'Position';
if ($fieldnamekey == 'unicode') $fieldnamekey = 'Unicode';

$msg.=$langs->trans("ErrorFieldRequired",$langs->transnoentities($fieldnamekey)).'<br>';
$msg.=$langs->transnoentities("ErrorFieldRequired", $langs->transnoentities($fieldnamekey)).'<br>';
}
}
// Other checks
if ($tabname[$id] == MAIN_DB_PREFIX."c_actioncomm" && isset($_POST["type"]) && in_array($_POST["type"],array('system','systemauto'))) {
$ok=0;
$msg.="Value 'system' and 'systemauto' for type is reserved. You can use 'user' as value to add your own record.<br>";
}
if (isset($_POST["code"]) && $_POST["code"]=='0') {
$ok=0;
$msg.="Code can't contains value 0<br>";
if (isset($_POST["code"])
{
if ($_POST["code"]=='0')
{
$ok=0;
$msg.="Code can't contains value 0<br>";
}
if (!is_numeric($_POST['code']))
{
$ok = 0;
$msg .= $langs->transnoentities('ErrorFieldFormat', $langs->transnoentities('Code')).'<br />';
}
}
if (isset($_POST["pays"]) && $_POST["pays"]=='0') {
$ok=0;
$msg.=$langs->trans("ErrorFieldRequired",$langs->trans("Country")).'<br>';
$msg.=$langs->transnoentities("ErrorFieldRequired",$langs->transnoentities("Country")).'<br>';
}

// Clean some parameters
if (isset($_POST["localtax1"]) && empty($_POST["localtax1"])) $_POST["localtax1"]='0'; // If empty, we force to 0
if (isset($_POST["localtax2"]) && empty($_POST["localtax2"])) $_POST["localtax2"]='0'; // If empty, we force to 0
Expand Down Expand Up @@ -510,7 +520,7 @@
else
{
if ($db->errno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') {
$msg=$langs->trans("ErrorRecordAlreadyExists").'<br>';
$msg=$langs->transnoentities("ErrorRecordAlreadyExists").'<br>';
}
else {
dol_print_error($db);
Expand Down Expand Up @@ -580,7 +590,7 @@
{
if ($db->errno() == 'DB_ERROR_CHILD_EXISTS')
{
$msg='<div class="error">'.$langs->trans("ErrorRecordIsUsedByChild").'</div>';
$msg='<div class="error">'.$langs->transnoentities("ErrorRecordIsUsedByChild").'</div>';
}
else
{
Expand Down

0 comments on commit de2a5a8

Please sign in to comment.