Merge pull request #3739 from GPCsolutions/3.8-3728
Fix #3728 Properly remove last category
This commit is contained in:
commit
ff1f7f1a48
@ -1991,12 +1991,14 @@ 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,12 +1155,14 @@ 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,12 +3976,14 @@ 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,12 +3395,14 @@ 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