mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-06-02 04:15:05 +02:00
- bug 183 fixed: Warning when trying to associate an image with an already
associated category. Just coded the TODO instructions I had let some time ago. git-svn-id: http://piwigo.org/svn/trunk@916 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
@@ -116,20 +116,29 @@ SELECT image_id
|
||||
;';
|
||||
$associated = array_from_query($query, 'image_id');
|
||||
|
||||
// TODO : if $associable array is empty, no further actions
|
||||
$associable = array_diff($collection, $associated);
|
||||
|
||||
foreach ($associable as $item)
|
||||
|
||||
if (count($associable) != 0)
|
||||
{
|
||||
array_push($datas,
|
||||
array('category_id'=>$_POST['associate'],
|
||||
'image_id'=>$item));
|
||||
}
|
||||
foreach ($associable as $item)
|
||||
{
|
||||
array_push(
|
||||
$datas,
|
||||
array(
|
||||
'category_id' => $_POST['associate'],
|
||||
'image_id' => $item
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
mass_inserts(IMAGE_CATEGORY_TABLE,
|
||||
array('image_id', 'category_id'),
|
||||
$datas);
|
||||
update_category(array($_POST['associate']));
|
||||
mass_inserts(
|
||||
IMAGE_CATEGORY_TABLE,
|
||||
array('image_id', 'category_id'),
|
||||
$datas
|
||||
);
|
||||
|
||||
update_category(array($_POST['associate']));
|
||||
}
|
||||
}
|
||||
|
||||
if ($_POST['dissociate'] != 0 and count($collection) > 0)
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
2005-10-25 Pierrick LE GALL
|
||||
|
||||
* bug 183 fixed: Warning when trying to associate an image with an
|
||||
already associated category. Just coded the TODO instructions I
|
||||
had let some time ago.
|
||||
|
||||
2005-10-23 chrisaga
|
||||
|
||||
* bug 184 fixed: .png button left aligned in IE
|
||||
|
||||
Reference in New Issue
Block a user