mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
FIX Linked elements not up to date (#32118)
* FIX Linked elements not up to date If you add a linked element, it won't appear without this correction, and if you delete an element, it won't disappear. You're forced to refresh the page to have the links updated, which is rather unpleasant. * Update actions_dellink.inc.php * Update actions_dellink.inc.php --------- Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
This commit is contained in:
parent
1b6ee9e654
commit
d343807a04
|
|
@ -50,6 +50,7 @@ if ($action == 'addlink' && !empty($permissiondellink) && !$cancellink && $id >
|
|||
foreach ($addlinkids as $addlinkid) {
|
||||
$result = $object->add_object_linked($addlink, $addlinkid);
|
||||
}
|
||||
$object->clearObjectLinkedCache();
|
||||
}
|
||||
|
||||
// Link by reference
|
||||
|
|
@ -69,6 +70,7 @@ if ($action == 'addlinkbyref' && !empty($permissiondellink) && !$cancellink && $
|
|||
if (isset($_POST['reftolinkto'])) {
|
||||
unset($_POST['reftolinkto']);
|
||||
}
|
||||
$object->clearObjectLinkedCache();
|
||||
} elseif ($ret < 0) {
|
||||
setEventMessages($objecttmp->error, $objecttmp->errors, 'errors');
|
||||
} else {
|
||||
|
|
@ -81,6 +83,7 @@ if ($action == 'addlinkbyref' && !empty($permissiondellink) && !$cancellink && $
|
|||
// Delete link in table llx_element_element
|
||||
if ($action == 'dellink' && !empty($permissiondellink) && !$cancellink && $dellinkid > 0) {
|
||||
$result = $object->deleteObjectLinked(0, '', 0, '', $dellinkid);
|
||||
$object->clearObjectLinkedCache();
|
||||
if ($result < 0) {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user