From 6c147eda5417f3cce58b4d235b21e15ef73c4fd5 Mon Sep 17 00:00:00 2001 From: plegall Date: Mon, 7 May 2007 22:00:47 +0000 Subject: Bug 538 fixed: when managing elements of a virtual category, dissociating some elements of the current category now instantly removes the elements of the element list. git-svn-id: http://piwigo.org/svn/trunk@2003 68402e56-0260-453c-a942-63ccdbb3a9ee --- admin/element_set_global.php | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'admin/element_set_global.php') 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']); } -- cgit v1.2.3