Merge pull request #7216 from atm-florian/fix_7213

FIX : #7213
This commit is contained in:
Laurent Destailleur 2017-07-31 02:29:36 +02:00 committed by GitHub
commit 4f0b35874d
2 changed files with 56 additions and 55 deletions

View File

@ -249,9 +249,10 @@ class ProductCombination
/** /**
* Deletes a product combination * Deletes a product combination
* *
* @param User $user
* @return int <0 KO >0 OK * @return int <0 KO >0 OK
*/ */
public function delete() public function delete(User $user)
{ {
$this->db->begin(); $this->db->begin();

View File

@ -234,7 +234,7 @@ if ($action === 'confirm_deletecombination') {
$db->begin(); $db->begin();
if ($prodcomb->delete() > 0 && $prodstatic->fetch($prodcomb->fk_product_child) > 0 && $prodstatic->delete() > 0) { if ($prodcomb->delete($user) > 0 && $prodstatic->fetch($prodcomb->fk_product_child) > 0 && $prodstatic->delete($user) > 0) {
$db->commit(); $db->commit();
setEventMessage($langs->trans('RecordSaved')); setEventMessage($langs->trans('RecordSaved'));
header('Location: '.dol_buildpath('/variants/combinations.php?id='.$object->id, 2)); header('Location: '.dol_buildpath('/variants/combinations.php?id='.$object->id, 2));