aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorplegall <plg@piwigo.org>2005-06-11 11:29:32 +0000
committerplegall <plg@piwigo.org>2005-06-11 11:29:32 +0000
commit4fedaac43ac404dc50193d6032307697412bb2c9 (patch)
tree2950551f6f6dee6b1788682cb4d705cc472fa350
parent6a9e165e32a7613bd4e381011993d2461d3b03df (diff)
- bug 96 (informations given by uploaders are lost) correction reported from
branch 1.4 git-svn-id: http://piwigo.org/svn/trunk@791 68402e56-0260-453c-a942-63ccdbb3a9ee
-rw-r--r--admin/update.php56
-rw-r--r--doc/ChangeLog5
2 files changed, 61 insertions, 0 deletions
diff --git a/admin/update.php b/admin/update.php
index 56843d21a..59e748198 100644
--- a/admin/update.php
+++ b/admin/update.php
@@ -453,6 +453,62 @@ SELECT IF(MAX(id)+1 IS NULL, 1, MAX(id)+1) AS next_element_id
echo '<!-- scanning files : ';
echo get_elapsed_time($start_files, get_moment());
echo ' -->'."\n";
+
+ // retrieving informations given by uploaders
+ if (!$simulate)
+ {
+ $query = '
+SELECT id,file,storage_category_id,infos
+ FROM '.WAITING_TABLE.'
+ WHERE storage_category_id IN (
+'.wordwrap(implode(', ', $cat_ids), 80, "\n").')
+ AND validated = \'true\'
+;';
+ $result = pwg_query($query);
+
+ $datas = array();
+ $fields =
+ array(
+ 'primary' => array('id'),
+ 'update' => array('date_creation', 'author', 'name', 'comment')
+ );
+
+ $waiting_to_delete = array();
+
+ while ($row = mysql_fetch_array($result))
+ {
+ $data = array();
+
+ $query = '
+SELECT id
+ FROM '.IMAGES_TABLE.'
+ WHERE storage_category_id = \''.$row['storage_category_id'].'\'
+ AND file = \''.$row['file'].'\'
+;';
+ list($data['id']) = mysql_fetch_array(pwg_query($query));
+
+ foreach ($fields['update'] as $field)
+ {
+ $data[$field] = getAttribute($row['infos'], $field);
+ }
+
+ array_push($datas, $data);
+ array_push($waiting_to_delete, $row['id']);
+ }
+
+ if (count($datas) > 0)
+ {
+ mass_updates(IMAGES_TABLE, $fields, $datas);
+
+ // delete now useless waiting elements
+ $query = '
+DELETE
+ FROM '.WAITING_TABLE.'
+ WHERE id IN ('.implode(',', $waiting_to_delete).')
+;';
+ pwg_query($query);
+ }
+ }
}
// +-----------------------------------------------------------------------+
// | template initialization |
diff --git a/doc/ChangeLog b/doc/ChangeLog
index 2887060bb..cd9c18b98 100644
--- a/doc/ChangeLog
+++ b/doc/ChangeLog
@@ -1,3 +1,8 @@
+2005-06-11 Pierrick LE GALL
+
+ * bug 96 (informations given by uploaders are lost) correction
+ reported from branch 1.4
+
2005-05-10 Pierrick LE GALL
* user list : links to profile page and permissions page are