Fix: A delete must always be done on a fully loaded object.
This commit is contained in:
parent
0a4ffe6e69
commit
52e2253e20
@ -141,7 +141,8 @@ if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->facture->
|
|||||||
{
|
{
|
||||||
if ($user->rights->facture->supprimer)
|
if ($user->rights->facture->supprimer)
|
||||||
{
|
{
|
||||||
$result = $object->delete($id);
|
$result = $object->fetch($id);
|
||||||
|
$result = $object->delete();
|
||||||
if ($result > 0)
|
if ($result > 0)
|
||||||
{
|
{
|
||||||
Header('Location: '.$_SERVER["PHP_SELF"]);
|
Header('Location: '.$_SERVER["PHP_SELF"]);
|
||||||
|
|||||||
@ -1119,7 +1119,7 @@ class Facture extends CommonObject
|
|||||||
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers
|
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
function delete($rowid, $notrigger=0)
|
function delete($rowid=0, $notrigger=0)
|
||||||
{
|
{
|
||||||
global $user,$langs,$conf;
|
global $user,$langs,$conf;
|
||||||
|
|
||||||
@ -1131,7 +1131,7 @@ class Facture extends CommonObject
|
|||||||
|
|
||||||
$error=0;
|
$error=0;
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
if (! $error && ! $notrigger)
|
if (! $error && ! $notrigger)
|
||||||
{
|
{
|
||||||
// Appel des triggers
|
// Appel des triggers
|
||||||
@ -1143,7 +1143,7 @@ class Facture extends CommonObject
|
|||||||
}
|
}
|
||||||
// Fin appel triggers
|
// Fin appel triggers
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
// Delete linked object
|
// Delete linked object
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user