aboutsummaryrefslogtreecommitdiffstats
path: root/admin/picture_modify.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/picture_modify.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/picture_modify.php')
-rw-r--r--admin/picture_modify.php22
1 files changed, 18 insertions, 4 deletions
diff --git a/admin/picture_modify.php b/admin/picture_modify.php
index d9437eb20..5c71610da 100644
--- a/admin/picture_modify.php
+++ b/admin/picture_modify.php
@@ -177,7 +177,12 @@ SELECT *
;';
$row = mysql_fetch_array(pwg_query($query));
-$storage_category_id = $row['storage_category_id'];
+$storage_category_id = null;
+if (!empty($row['storage_category_id']))
+{
+ $storage_category_id = $row['storage_category_id'];
+}
+
$image_file = $row['file'];
// tags
@@ -397,13 +402,22 @@ $query = '
SELECT id,name,uppercats,global_rank
FROM '.CATEGORIES_TABLE.'
INNER JOIN '.IMAGE_CATEGORY_TABLE.' ON id = category_id
- WHERE image_id = '.$_GET['image_id'].'
- AND id != '.$storage_category_id.'
+ WHERE image_id = '.$_GET['image_id'];
+if (isset($storage_category_id))
+{
+ $query.= '
+ AND id != '.$storage_category_id;
+}
+$query.= '
;';
display_select_cat_wrapper($query, array(), 'associated_options');
$result = pwg_query($query);
-$associateds = array($storage_category_id);
+$associateds = array();
+if (isset($storage_category_id))
+{
+ array_push($associateds, $storage_category_id);
+}
while ($row = mysql_fetch_array($result))
{
array_push($associateds, $row['id']);