| 1 |
<?php |
<?php |
| 2 |
// $Id: emfield.install,v 1.1.6.11 2009/09/30 21:05:09 aaron Exp $ |
// $Id: emfield.install,v 1.1.6.12 2009/10/05 19:05:10 aaron Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* @file |
* @file |
| 54 |
} |
} |
| 55 |
|
|
| 56 |
/** |
/** |
| 57 |
* Add a provider data version column to existing fields. |
* This caused an infinite loop in some cases. Redo in 6005. |
| 58 |
*/ |
*/ |
| 59 |
function emfield_update_6003() { |
function emfield_update_6003() { |
| 60 |
|
return array(); |
| 61 |
|
} |
| 62 |
|
|
| 63 |
|
/** |
| 64 |
|
* Rebuild themes. |
| 65 |
|
*/ |
| 66 |
|
function emfield_update_6004() { |
| 67 |
|
drupal_rebuild_theme_registry(); |
| 68 |
|
return array(); |
| 69 |
|
} |
| 70 |
|
|
| 71 |
|
/** |
| 72 |
|
* Add a provider data version column to existing fields. |
| 73 |
|
*/ |
| 74 |
|
function emfield_update_6005() { |
| 75 |
$ret = array(); |
$ret = array(); |
| 76 |
|
|
| 77 |
include_once(drupal_get_path('module', 'content') .'/includes/content.admin.inc'); |
include_once(drupal_get_path('module', 'content') .'/includes/content.admin.inc'); |
| 148 |
} |
} |
| 149 |
|
|
| 150 |
/** |
/** |
|
* Rebuild themes. |
|
|
*/ |
|
|
function emfield_update_6004() { |
|
|
drupal_rebuild_theme_registry(); |
|
|
return array(); |
|
|
} |
|
|
|
|
|
/** |
|
| 151 |
* Batch function to retrieve the most recent data from providers. |
* Batch function to retrieve the most recent data from providers. |
| 152 |
* |
* |
| 153 |
* @param $field |
* @param $field |
| 189 |
// Work our way through the field values 50 rows at a time. |
// Work our way through the field values 50 rows at a time. |
| 190 |
$limit = 50; |
$limit = 50; |
| 191 |
if (empty($context['sandbox']['providers'])) { |
if (empty($context['sandbox']['providers'])) { |
| 192 |
$result = db_query_range("SELECT * FROM {{$context['sandbox']['table']}} WHERE vid > %d ORDER BY nid ASC", $context['sandbox']['current_node'], 0, $limit); |
$result = db_query_range("SELECT * FROM {{$context['sandbox']['table']}} WHERE vid > %d ORDER BY vid ASC", $context['sandbox']['current_node'], 0, $limit); |
| 193 |
} |
} |
| 194 |
else { |
else { |
| 195 |
$result = db_query_range("SELECT * FROM {{$context['sandbox']['table']}} WHERE vid > %d AND ". $context['sandbox']['col_provider'] ." in (". $context['sandbox']['provider_placeholders'] .") ORDER BY nid ASC", $context['sandbox']['current_node'], implode(', ', $context['sandbox']['providers']), 0, $limit); |
$result = db_query_range("SELECT * FROM {{$context['sandbox']['table']}} WHERE vid > %d AND ". $context['sandbox']['col_provider'] ." in (". $context['sandbox']['provider_placeholders'] .") ORDER BY vid ASC", $context['sandbox']['current_node'], implode(', ', $context['sandbox']['providers']), 0, $limit); |
| 196 |
} |
} |
| 197 |
while ($row = db_fetch_array($result)) { |
while ($row = db_fetch_array($result)) { |
| 198 |
// Fetch the duration from the provider. |
// Fetch the duration from the provider. |