diff options
author | plegall <plg@piwigo.org> | 2007-05-07 22:00:47 +0000 |
---|---|---|
committer | plegall <plg@piwigo.org> | 2007-05-07 22:00:47 +0000 |
commit | 6c147eda5417f3cce58b4d235b21e15ef73c4fd5 (patch) | |
tree | 4e4aa7d3bffcc5fc4cb81c956d87f1087f89fd91 | |
parent | 3ae12221acad3ea0fe764391212177d258ff0af8 (diff) |
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
-rw-r--r-- | admin/element_set_global.php | 15 |
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']); } |