Fix #3728 Properly remove last category
This commit is contained in:
parent
05686b532c
commit
6c2b46f939
@ -1991,12 +1991,14 @@ class Adherent extends CommonObject
|
||||
|
||||
// Process
|
||||
foreach ($to_del as $del) {
|
||||
$c->fetch($del);
|
||||
$c->del_type($this, 'member');
|
||||
if ($c->fetch($del) > 0) {
|
||||
$c->del_type($this, 'member');
|
||||
}
|
||||
}
|
||||
foreach ($to_add as $add) {
|
||||
$c->fetch($add);
|
||||
$c->add_type($this, 'member');
|
||||
if ($c->fetch($add) > 0) {
|
||||
$c->add_type($this, 'member');
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
|
||||
@ -1155,12 +1155,14 @@ class Contact extends CommonObject
|
||||
|
||||
// Process
|
||||
foreach ($to_del as $del) {
|
||||
$c->fetch($del);
|
||||
$c->del_type($this, 'contact');
|
||||
if ($c->fetch($del) > 0) {
|
||||
$c->del_type($this, 'contact');
|
||||
}
|
||||
}
|
||||
foreach ($to_add as $add) {
|
||||
$c->fetch($add);
|
||||
$c->add_type($this, 'contact');
|
||||
if ($c->fetch($add) > 0) {
|
||||
$c->add_type($this, 'contact');
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
|
||||
@ -3976,12 +3976,14 @@ class Product extends CommonObject
|
||||
|
||||
// Process
|
||||
foreach($to_del as $del) {
|
||||
$c->fetch($del);
|
||||
$c->del_type($this, 'product');
|
||||
if ($c->fetch($del) > 0) {
|
||||
$c->del_type($this, 'product');
|
||||
}
|
||||
}
|
||||
foreach ($to_add as $add) {
|
||||
$c->fetch($add);
|
||||
$c->add_type($this, 'product');
|
||||
if ($c->fetch($add) > 0) {
|
||||
$c->add_type($this, 'product');
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
|
||||
@ -3395,12 +3395,14 @@ class Societe extends CommonObject
|
||||
|
||||
// Process
|
||||
foreach ($to_del as $del) {
|
||||
$c->fetch($del);
|
||||
$c->del_type($this, $type_text);
|
||||
if ($c->fetch($del) > 0) {
|
||||
$c->del_type($this, $type_text);
|
||||
}
|
||||
}
|
||||
foreach ($to_add as $add) {
|
||||
$c->fetch($add);
|
||||
$c->add_type($this, $type_text);
|
||||
if ($c->fetch($add) > 0) {
|
||||
$c->add_type($this, $type_text);
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user