Skip to content
This repository has been archived by the owner on Jun 14, 2018. It is now read-only.

Commit

Permalink
Bugfix inside delete.php
Browse files Browse the repository at this point in the history
  • Loading branch information
aldus committed Jul 20, 2016
1 parent d0f133b commit a4cddc2
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions delete.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,17 @@
// end include class.secure.php

// Delete DB-Entries (messages and settings)
$sql = 'SELECT `parent` FROM '.TABLE_PREFIX.'mod_foldergallery_jq_categories WHERE section_id='.$section_id.';';
$query = $database->query($sql);
while($cat = $query->fetchRow( )) {
$sql = 'DELETE FROM '.TABLE_PREFIX.'mod_foldergallery_jq_files WHERE parent_id='.$cat['parent'];
$database->query($sql);
}
$temp_parent_ids = array();
$database->execute_query(
'SELECT `id` FROM `'.TABLE_PREFIX.'mod_foldergallery_jq_categories` WHERE `section_id`='.$section_id.';',
true,
$temp_parent_ids
);

foreach($temp_parent_ids as $parent) {
$database->query('DELETE FROM `'.TABLE_PREFIX.'mod_foldergallery_jq_files` WHERE `parent_id`='.$parent['id']);
}

$database->query("DELETE FROM `".TABLE_PREFIX."mod_foldergallery_jq_settings` WHERE `page_id` = '$page_id' AND `section_id` = '$section_id'");
$database->query("DELETE FROM `".TABLE_PREFIX."mod_foldergallery_jq_categories` WHERE `section_id` = '$section_id'");

Expand Down

0 comments on commit a4cddc2

Please sign in to comment.