Changeset 1427


Ignore:
Timestamp:
Jul 4, 2006, 12:52:17 AM (18 years ago)
Author:
plg
Message:

bug 397 fixed: very strange one. During insert of a new distant category,
instead of setting categories.uploadable to 'false', it is set to
NULL. Which is incorrect. The problem seems to come from a type comparison
with operator "==".

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/branch-1_6/admin/include/functions.php

    r1283 r1427  
    608608      }
    609609
    610       if (!isset($insert[$dbfield]) or $insert[$dbfield] == '')
     610      if (!isset($insert[$dbfield]) or $insert[$dbfield] === '')
    611611      {
    612612        $query.= 'NULL';
     
    941941;';
    942942    list($representative) = mysql_fetch_array(pwg_query($query));
    943     $data = array('id' => $category_id,
    944                   'representative_picture_id' => $representative);
    945     array_push($datas, $data);
    946   }
    947 
    948   $fields = array('primary' => array('id'),
    949                   'update' => array('representative_picture_id'));
    950   mass_updates(CATEGORIES_TABLE, $fields, $datas);
     943
     944    array_push(
     945      $datas,
     946      array(
     947        'id' => $category_id,
     948        'representative_picture_id' => $representative,
     949        )
     950      );
     951  }
     952
     953  mass_updates(
     954    CATEGORIES_TABLE,
     955    array(
     956      'primary' => array('id'),
     957      'update' => array('representative_picture_id')
     958      ),
     959    $datas
     960    );
    951961}
    952962
Note: See TracChangeset for help on using the changeset viewer.