diff options
author | plegall <plg@piwigo.org> | 2012-09-18 11:43:36 +0000 |
---|---|---|
committer | plegall <plg@piwigo.org> | 2012-09-18 11:43:36 +0000 |
commit | a1002f61fd0a9671ea1dd70f0ac3385db9cf6c16 (patch) | |
tree | d7c472d5a7ff83d97a99cd058528d41a9322793a /admin/include | |
parent | a12e006c89bd43cbbd6c89d826506de8cc09c081 (diff) |
little code refactoring over r17424
bug fixed on Edit Photo page when associating with no album.
git-svn-id: http://piwigo.org/svn/trunk@17980 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r-- | admin/include/functions.php | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/admin/include/functions.php b/admin/include/functions.php index 30f1517e9..7c89c002b 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); |