aboutsummaryrefslogtreecommitdiffstats
path: root/admin/element_set_global.php
diff options
context:
space:
mode:
authorplegall <plg@piwigo.org>2008-09-23 21:26:36 +0000
committerplegall <plg@piwigo.org>2008-09-23 21:26:36 +0000
commit52f0cce24f871ed187408ca0f4e33f4ee8863cfe (patch)
treea94a1a39ae4068674aafef65ade5a93264a8b3f5 /admin/element_set_global.php
parent8ffef257e1c856aa3c91824e1158aefd170c5260 (diff)
bug fixed: now that WebService method pwg.images.add create image records
with no storage_category_id, we allow this field to be null in the administration code. git-svn-id: http://piwigo.org/svn/trunk@2575 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'admin/element_set_global.php')
-rw-r--r--admin/element_set_global.php25
1 files changed, 17 insertions, 8 deletions
diff --git a/admin/element_set_global.php b/admin/element_set_global.php
index 4b22f112f..e0df2d96b 100644
--- a/admin/element_set_global.php
+++ b/admin/element_set_global.php
@@ -107,9 +107,13 @@ SELECT id
INNER JOIN '.IMAGES_TABLE.' ON image_id = id
WHERE category_id = '.$_POST['dissociate'].'
AND id IN ('.implode(',', $collection).')
- AND category_id != storage_category_id
+ AND (
+ category_id != storage_category_id
+ OR storage_category_id IS NULL
+ )
;';
$dissociables = array_from_query($query, 'id');
+ echo '<pre>'; print_r($dissociables); echo '</pre>';
if (!empty($dissociables))
{
@@ -245,14 +249,19 @@ display_select_cat_wrapper($query, array(), 'associate_options', true);
if (count($page['cat_elements_id']) > 0)
{
$query = '
-SELECT DISTINCT(category_id) AS id, c.name, uppercats, global_rank
- FROM '.IMAGE_CATEGORY_TABLE.' AS ic,
- '.CATEGORIES_TABLE.' AS c,
- '.IMAGES_TABLE.' AS i
+SELECT
+ DISTINCT(category_id) AS id,
+ c.name,
+ c.uppercats,
+ c.global_rank
+ FROM '.IMAGE_CATEGORY_TABLE.' AS ic
+ JOIN '.CATEGORIES_TABLE.' AS c ON c.id = ic.category_id
+ JOIN '.IMAGES_TABLE.' AS i ON i.id = ic.image_id
WHERE ic.image_id IN ('.implode(',', $page['cat_elements_id']).')
- AND ic.category_id = c.id
- AND ic.image_id = i.id
- AND ic.category_id != i.storage_category_id
+ AND (
+ ic.category_id != i.storage_category_id
+ OR i.storage_category_id IS NULL
+ )
;';
display_select_cat_wrapper($query, array(), 'dissociate_options', true);
}