Ignore:
Timestamp:
Sep 23, 2008, 11:26:36 PM (16 years ago)
Author:
plg
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/picture_modify.php

    r2530 r2575  
    178178$row = mysql_fetch_array(pwg_query($query));
    179179
    180 $storage_category_id = $row['storage_category_id'];
     180$storage_category_id = null;
     181if (!empty($row['storage_category_id']))
     182{
     183  $storage_category_id = $row['storage_category_id'];
     184}
     185
    181186$image_file = $row['file'];
    182187
     
    398403  FROM '.CATEGORIES_TABLE.'
    399404    INNER JOIN '.IMAGE_CATEGORY_TABLE.' ON id = category_id
    400   WHERE image_id = '.$_GET['image_id'].'
    401     AND id != '.$storage_category_id.'
     405  WHERE image_id = '.$_GET['image_id'];
     406if (isset($storage_category_id))
     407{
     408  $query.= '
     409    AND id != '.$storage_category_id;
     410}
     411$query.= '
    402412;';
    403413display_select_cat_wrapper($query, array(), 'associated_options');
    404414
    405415$result = pwg_query($query);
    406 $associateds = array($storage_category_id);
     416$associateds = array();
     417if (isset($storage_category_id))
     418{
     419  array_push($associateds, $storage_category_id);
     420}
    407421while ($row = mysql_fetch_array($result))
    408422{
Note: See TracChangeset for help on using the changeset viewer.