aboutsummaryrefslogtreecommitdiffstats
path: root/admin/element_set_global.php
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--admin/element_set_global.php15
1 files changed, 10 insertions, 5 deletions
diff --git a/admin/element_set_global.php b/admin/element_set_global.php
index 568a37efb..b3f254b10 100644
--- a/admin/element_set_global.php
+++ b/admin/element_set_global.php
@@ -114,16 +114,21 @@ SELECT id
;';
$dissociables = array_from_query($query, 'id');
- if (!empty($dissociables))
- {
- $query = '
+ if (!empty($dissociables))
+ {
+ $query = '
DELETE
FROM '.IMAGE_CATEGORY_TABLE.'
WHERE category_id = '.$_POST['dissociate'].'
AND image_id IN ('.implode(',', $dissociables).')
';
- pwg_query($query);
- }
+ pwg_query($query);
+
+ $page['cat_elements_id'] = array_diff(
+ $page['cat_elements_id'],
+ $dissociables
+ );
+ }
update_category($_POST['dissociate']);
}