Fix: Do not loose data from post if it fails
This commit is contained in:
parent
4677ebd4aa
commit
06dc5aa9dd
@ -100,7 +100,7 @@ if (empty($reshook))
|
||||
if ($action == 'setbarcodetype' && $user->rights->barcode->creer)
|
||||
{
|
||||
$object->fetch($id);
|
||||
$result = $object->setValueFrom('fk_barcode_type', $_POST['barcodetype_id']);
|
||||
$result = $object->setValueFrom('fk_barcode_type', $_POST['fk_barcode_type']);
|
||||
Header("Location: ".$_SERVER['PHP_SELF']."?id=".$id);
|
||||
exit;
|
||||
}
|
||||
@ -118,7 +118,7 @@ if (empty($reshook))
|
||||
if ($action == 'setaccountancy_code_buy')
|
||||
{
|
||||
$object->fetch($id,$ref);
|
||||
$result = $object->setValueFrom('accountancy_code_buy', $_POST['productaccountancycodebuy']);
|
||||
$result = $object->setValueFrom('accountancy_code_buy', $_POST['accountancy_code_buy']);
|
||||
if ($result < 0)
|
||||
{
|
||||
$mesg=join(',',$product->errors);
|
||||
@ -131,7 +131,7 @@ if (empty($reshook))
|
||||
$object->fetch($id,$ref);
|
||||
$product->accountancy_code_sell=$_POST["productaccountancycodesell"];
|
||||
$result=$product->update($product->id,$user,1,0,1);
|
||||
$result = $object->setValueFrom('accountancy_code_sell', $_POST['productaccountancycodesell']);
|
||||
$result = $object->setValueFrom('accountancy_code_sell', $_POST['accountancy_code_sell']);
|
||||
if ($result < 0)
|
||||
{
|
||||
$mesg=join(',',$product->errors);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user