Skip to content

Commit

Permalink
Fix: Do not loose data from post if it fails
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Mar 4, 2012
1 parent 4677ebd commit 06dc5aa
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions htdocs/product/fiche.php
Expand Up @@ -100,7 +100,7 @@
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;
}
Expand All @@ -118,7 +118,7 @@
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);
Expand All @@ -131,7 +131,7 @@
$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);
Expand Down

0 comments on commit 06dc5aa

Please sign in to comment.