mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-04-30 18:42:43 +02:00
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 "==". git-svn-id: http://piwigo.org/svn/branches/branch-1_6@1427 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
@@ -607,7 +607,7 @@ INSERT INTO '.$table_name.'
|
||||
$query.= ',';
|
||||
}
|
||||
|
||||
if (!isset($insert[$dbfield]) or $insert[$dbfield] == '')
|
||||
if (!isset($insert[$dbfield]) or $insert[$dbfield] === '')
|
||||
{
|
||||
$query.= 'NULL';
|
||||
}
|
||||
@@ -940,14 +940,24 @@ SELECT image_id
|
||||
LIMIT 0,1
|
||||
;';
|
||||
list($representative) = mysql_fetch_array(pwg_query($query));
|
||||
$data = array('id' => $category_id,
|
||||
'representative_picture_id' => $representative);
|
||||
array_push($datas, $data);
|
||||
|
||||
array_push(
|
||||
$datas,
|
||||
array(
|
||||
'id' => $category_id,
|
||||
'representative_picture_id' => $representative,
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
$fields = array('primary' => array('id'),
|
||||
'update' => array('representative_picture_id'));
|
||||
mass_updates(CATEGORIES_TABLE, $fields, $datas);
|
||||
mass_updates(
|
||||
CATEGORIES_TABLE,
|
||||
array(
|
||||
'primary' => array('id'),
|
||||
'update' => array('representative_picture_id')
|
||||
),
|
||||
$datas
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user