diff options
-rw-r--r-- | includes/update.inc | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/includes/update.inc b/includes/update.inc index d8ebd7ff1..6588fac00 100644 --- a/includes/update.inc +++ b/includes/update.inc @@ -410,15 +410,18 @@ function update_fix_d7_block_deltas(&$sandbox, $renamed_deltas, $moved_deltas) { // Initialize batch update information. $sandbox['progress'] = 0; $sandbox['last_user_processed'] = -1; - $sandbox['max'] = db_query("SELECT COUNT(*) FROM {users} WHERE data IS NOT NULL")->fetchField(); + $sandbox['max'] = db_query("SELECT COUNT(*) FROM {users} WHERE data LIKE :block", array( + ':block' => '%' . db_like(serialize('block')) . '%', + )) + ->fetchField(); } // Now do the batch update of the user-specific block visibility settings. $limit = 100; $result = db_select('users', 'u') ->fields('u', array('uid', 'data')) ->condition('uid', $sandbox['last_user_processed'], '>') + ->condition('data', '%' . db_like(serialize('block')) . '%', 'LIKE') ->orderBy('uid', 'ASC') - ->where('data IS NOT NULL') ->range(0, $limit) ->execute(); foreach ($result as $row) { |