Merge pull request #9724 from Librethic/fix_position_email_template

FIX : position 0 for emails templates
This commit is contained in:
Laurent Destailleur 2018-10-12 17:48:52 +02:00 committed by GitHub
commit 062d8a4bdb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -319,10 +319,11 @@ if (empty($reshook))
if ($i) $sql.=",";
$sql.= $field."=";
// print $keycode.' - '.$_POST[$keycode].'<br>';
if ($_POST[$keycode] == '' || ($keycode != 'langcode' && $keycode != 'private' && empty($_POST[$keycode]))) $sql.="null"; // lang must be '' if not defined so the unique key that include lang will work
elseif ($_POST[$keycode] == '0' && $keycode == 'langcode') $sql.="''"; // lang must be '' if not defined so the unique key that include lang will work
elseif ($keycode == 'private') $sql.=((int) $_POST[$keycode]); // private must be 0 or 1
//print $keycode.' - '.$_POST[$keycode].'<br>';
if ($_POST[$keycode] == '' || ($keycode != 'langcode' && $keycode != 'position' && $keycode != 'private' && empty($_POST[$keycode]))) $sql.="null"; // lang must be '' if not defined so the unique key that include lang will work
elseif ($_POST[$keycode] == '0' && $keycode == 'langcode') $sql.="''"; // lang must be '' if not defined so the unique key that include lang will work
elseif ($keycode == 'private') $sql.=((int) $_POST[$keycode]); // private must be 0 or 1
elseif ($keycode == 'position') $sql.=((int) $_POST[$keycode]);
else $sql.="'".$db->escape($_POST[$keycode])."'";
$i++;
}