Merge branch 'revert-ea0474e7' into 'develop'

Revert "Merge branch '2677-No-se-elimina-parent-id-entre-modulos-del-mismo-agente' into 'develop'"

See merge request artica/pandorafms!1935
This commit is contained in:
vgilc 2018-11-06 17:00:11 +01:00
commit c18bb1c827
1 changed files with 1 additions and 11 deletions

View File

@ -292,22 +292,12 @@ sub pandora_purgedb ($$) {
# Delete pending modules
log_message ('PURGE', "Deleting pending delete modules (data table).", '');
my @deleted_modules = get_db_rows ($dbh, 'SELECT id_agente_modulo FROM tagente_modulo WHERE delete_pending = 1');
my @all_modules = get_db_rows ($dbh, 'SELECT id_agente_modulo, parent_module_id FROM tagente_modulo');
foreach my $module (@deleted_modules) {
my $buffer = 1000;
my $id_module = $module->{'id_agente_modulo'};
foreach my $m (@all_modules) {
my $id_parent = $m->{'parent_module_id'};
my $id_module_fetched = $m->{'id_agente_modulo'};
if ($id_parent == $id_module) {
db_do ($dbh, 'UPDATE tagente_modulo SET parent_module_id=0 WHERE id_agente_modulo=?', $id_module_fetched);
}
}
log_message ('', ".");
while(1) {