summaryrefslogtreecommitdiff
path: root/modules/system/system.queue.inc
diff options
context:
space:
mode:
authorAngie Byron <webchick@24967.no-reply.drupal.org>2010-01-09 02:51:09 +0000
committerAngie Byron <webchick@24967.no-reply.drupal.org>2010-01-09 02:51:09 +0000
commit1f6a553cd2f8eeb531e6404d793797cb19bcfaf4 (patch)
treed6202498a9abe607b3d7252a0a9ce99c9318ea76 /modules/system/system.queue.inc
parent25747314e2b923f90f44e69c896d3aa0e0087dce (diff)
downloadbrdo-1f6a553cd2f8eeb531e6404d793797cb19bcfaf4.tar.gz
brdo-1f6a553cd2f8eeb531e6404d793797cb19bcfaf4.tar.bz2
#629794 follow-up by yched: Fixed batch API in update.php.
Diffstat (limited to 'modules/system/system.queue.inc')
-rw-r--r--modules/system/system.queue.inc18
1 files changed, 11 insertions, 7 deletions
diff --git a/modules/system/system.queue.inc b/modules/system/system.queue.inc
index bac1ff26e..586681181 100644
--- a/modules/system/system.queue.inc
+++ b/modules/system/system.queue.inc
@@ -179,13 +179,17 @@ class SystemQueue implements DrupalQueueInterface {
}
public function createItem($data) {
- $record = new stdClass();
- $record->name = $this->name;
- $record->data = $data;
- // We cannot rely on REQUEST_TIME because many items might be created by a
- // single request which takes longer than 1 second.
- $record->created = time();
- return drupal_write_record('queue', $record) !== FALSE;
+ // During a Drupal 6.x to 7.x update, drupal_get_schema() does not contain
+ // the queue table yet, so we cannot rely on drupal_write_record().
+ $query = db_insert('queue')
+ ->fields(array(
+ 'name' => $this->name,
+ 'data' => serialize($data),
+ // We cannot rely on REQUEST_TIME because many items might be created
+ // by a single request which takes longer than 1 second.
+ 'created' => time(),
+ ));
+ return (bool) $query->execute();
}
public function numberOfItems() {