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