aboutsummaryrefslogtreecommitdiffstats
path: root/admin
diff options
context:
space:
mode:
authorplegall <plg@piwigo.org>2012-09-18 11:46:56 +0000
committerplegall <plg@piwigo.org>2012-09-18 11:46:56 +0000
commitb43df041d4fec796f8fa9a9db367fb40bd61fd8b (patch)
tree20098d7cdd8825d28f46d37d38fbbd577138d109 /admin
parent081566eb83c8be9924612afb1cda6e4a55bf4cb0 (diff)
merge r17980 from trunk to branch 2.4
little code refactoring over r17424 bug fixed on Edit Photo page when associating with no album. git-svn-id: http://piwigo.org/svn/branches/2.4@17982 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'admin')
-rw-r--r--admin/include/functions.php11
-rw-r--r--admin/picture_modify.php4
2 files changed, 14 insertions, 1 deletions
diff --git a/admin/include/functions.php b/admin/include/functions.php
index ea62a0bbb..16e21d827 100644
--- a/admin/include/functions.php
+++ b/admin/include/functions.php
@@ -1602,7 +1602,16 @@ DELETE '.IMAGE_CATEGORY_TABLE.'.*
FROM '.IMAGE_CATEGORY_TABLE.'
JOIN '.IMAGES_TABLE.' ON image_id=id
WHERE id IN ('.implode(',', $images).')
- '.((is_array($categories) and count($categories)>0) ? 'AND category_id NOT IN ('.implode(',', $categories).')' : null).'
+';
+
+ if (is_array($categories) and count($categories) > 0)
+ {
+ $query.= '
+ AND category_id NOT IN ('.implode(',', $categories).')
+';
+ }
+
+ $query.= '
AND (storage_category_id IS NULL OR storage_category_id != category_id)
;';
pwg_query($query);
diff --git a/admin/picture_modify.php b/admin/picture_modify.php
index acc7c010c..6dd218f80 100644
--- a/admin/picture_modify.php
+++ b/admin/picture_modify.php
@@ -171,6 +171,10 @@ if (isset($_POST['submit']) and count($page['errors']) == 0)
set_tags($tag_ids, $_GET['image_id']);
// association to albums
+ if (!isset($_POST['associate']))
+ {
+ $_POST['associate'] = array();
+ }
move_images_to_categories(array($_GET['image_id']), $_POST['associate']);
// thumbnail for albums