mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-31 01:35:36 +02:00
Merge branch 'ent-9181-problema-al-borrar-agentes-cuando-hay-modulos-delete-pending' into 'develop'
Ent 9181 problema al borrar agentes cuando hay modulos delete pending See merge request artica/pandorafms!4973
This commit is contained in:
commit
7e206716d7
@ -2598,10 +2598,9 @@ function agents_delete_agent($id_agents, $disableACL=false)
|
|||||||
'tagente_modulo',
|
'tagente_modulo',
|
||||||
$filter
|
$filter
|
||||||
);
|
);
|
||||||
|
|
||||||
if (is_array($rows) === true) {
|
if (is_array($rows) === true) {
|
||||||
foreach ($rows as $row) {
|
foreach ($rows as $row) {
|
||||||
$modules[] = PandoraFMS\Module::build($row);
|
$modules[] = PandoraFMS\Module::build($row, '\PandoraFMS\Module', true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -145,14 +145,15 @@ class Module extends Entity
|
|||||||
/**
|
/**
|
||||||
* Creates a module object from given data. Avoid query duplication.
|
* Creates a module object from given data. Avoid query duplication.
|
||||||
*
|
*
|
||||||
* @param array $data Module information.
|
* @param array $data Module information.
|
||||||
* @param string $class_str Class type.
|
* @param string $class_str Class type.
|
||||||
*
|
* @param boolean $return_deleted_modules Check.
|
||||||
* @return PandoraFMS\Module Object.
|
* @return PandoraFMS\Module Object.
|
||||||
*/
|
*/
|
||||||
public static function build(
|
public static function build(
|
||||||
array $data=[],
|
array $data=[],
|
||||||
string $class_str='\PandoraFMS\Module'
|
string $class_str='\PandoraFMS\Module',
|
||||||
|
bool $return_deleted_modules=false
|
||||||
) {
|
) {
|
||||||
$obj = new $class_str();
|
$obj = new $class_str();
|
||||||
|
|
||||||
@ -161,8 +162,9 @@ class Module extends Entity
|
|||||||
$obj->{$k}($v);
|
$obj->{$k}($v);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($obj->nombre() === 'delete_pending'
|
if (($obj->nombre() === 'delete_pending'
|
||||||
|| $obj->nombre() === 'pendingdelete'
|
|| $obj->nombre() === 'pendingdelete')
|
||||||
|
&& $return_deleted_modules === false
|
||||||
) {
|
) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user