[0;0m? sites/default/settings.php[0;0m
[1;32mIndex: includes/update.inc[0;0m
[1;32m===================================================================[0;0m
[1;32mRCS file: /cvs/drupal/drupal/includes/update.inc,v[0;0m
[1;32mretrieving revision 1.57[0;0m
[1;32mdiff -u -p -r1.57 update.inc[0;0m
[1;31m--- includes/update.inc	25 Jun 2010 17:47:22 -0000	1.57[0;0m
[1;34m+++ includes/update.inc	26 Jun 2010 07:25:30 -0000[0;0m
[1;35m@@ -221,6 +221,7 @@ function update_prepare_d7_bootstrap() {[0;0m
[0;0m  *   An associative array.  Keys are module names, values an associative array[0;0m
[0;0m  *   mapping the old block deltas to the new block deltas for the module.[0;0m
[0;0m  *   Example:[0;0m
[1;34m+ *   @code[0;0m
[0;0m  *     $renamed_deltas = array([0;0m
[0;0m  *       'mymodule' =>[0;0m
[0;0m  *         array([0;0m
[1;35m@@ -228,8 +229,21 @@ function update_prepare_d7_bootstrap() {[0;0m
[0;0m  *           1 => 'mymodule-block-2',[0;0m
[0;0m  *         ),[0;0m
[0;0m  *     );[0;0m
[1;34m+ *   @endcode[0;0m
[1;34m+ * @param $moved_deltas[0;0m
[1;34m+ *   An associative array. Keys are source module names, values an associative array[0;0m
[1;34m+ *   mappign the (possibly renamed) block name to the new module name.[0;0m
[1;34m+ *   Example:[0;0m
[1;34m+ *   @code[0;0m
[1;34m+ *     $moved_deltas = array([0;0m
[1;34m+ *       'user' =>[0;0m
[1;34m+ *         array([0;0m
[1;34m+ *           'navigation' => 'system',[0;0m
[1;34m+ *         ),[0;0m
[1;34m+ *     );[0;0m
[1;34m+ *   @endcode[0;0m
[0;0m  */[0;0m
[1;31m-function update_fix_d7_block_deltas(&$sandbox, $renamed_deltas) {[0;0m
[1;34m+function update_fix_d7_block_deltas(&$sandbox, $renamed_deltas, $moved_deltas) {[0;0m
[0;0m   // Loop through each block and make changes to the block tables.[0;0m
[0;0m   // Only run this the first time through the batch update.[0;0m
[0;0m   if (!isset($sandbox['progress'])) {[0;0m
[1;35m@@ -253,6 +267,23 @@ function update_fix_d7_block_deltas(&$sa[0;0m
[0;0m           }[0;0m
[0;0m         }[0;0m
[0;0m       }[0;0m
[1;34m+      foreach ($moved_deltas as $old_module => $deltas) {[0;0m
[1;34m+        foreach ($deltas as $delta => $new_module) {[0;0m
[1;34m+          // Only do the update if the old block actually exists.[0;0m
[1;34m+          $block_exists = db_query("SELECT COUNT(*) FROM {" . $table . "} WHERE module = :module AND delta = :delta", array([0;0m
[1;34m+            ':module' => $old_module,[0;0m
[1;34m+            ':delta' => $delta,[0;0m
[1;34m+          ))[0;0m
[1;34m+          ->fetchField();[0;0m
[1;34m+          if ($block_exists) {[0;0m
[1;34m+            db_update($table)[0;0m
[1;34m+              ->fields(array('module' => $new_module))[0;0m
[1;34m+              ->condition('module', $old_module)[0;0m
[1;34m+              ->condition('delta', $delta)[0;0m
[1;34m+              ->execute();[0;0m
[1;34m+          }[0;0m
[1;34m+        }[0;0m
[1;34m+      }[0;0m
[0;0m     }[0;0m
[0;0m [0;0m
[0;0m     // Initialize batch update information.[0;0m
[1;35m@@ -282,6 +313,17 @@ function update_fix_d7_block_deltas(&$sa[0;0m
[0;0m         }[0;0m
[0;0m       }[0;0m
[0;0m     }[0;0m
[1;34m+    foreach ($moved_deltas as $old_module => $deltas) {[0;0m
[1;34m+      foreach ($deltas as $delta => $new_module) {[0;0m
[1;34m+        if (isset($data['block'][$old_module][$delta])) {[0;0m
[1;34m+          // Transfer the old block visibility settings to the moved[0;0m
[1;34m+          // block, and mark this user for a database update.[0;0m
[1;34m+          $data['block'][$new_module][$delta] = $data['block'][$old_module][$delta];[0;0m
[1;34m+          unset($data['block'][$old_module][$delta]);[0;0m
[1;34m+          $user_needs_update = TRUE;[0;0m
[1;34m+        }[0;0m
[1;34m+      }[0;0m
[1;34m+    }[0;0m
[0;0m     // Update the current user.[0;0m
[0;0m     if ($user_needs_update) {[0;0m
[0;0m       db_update('users')[0;0m
[1;32mIndex: modules/system/system.install[0;0m
[1;32m===================================================================[0;0m
[1;32mRCS file: /cvs/drupal/drupal/modules/system/system.install,v[0;0m
[1;32mretrieving revision 1.481[0;0m
[1;32mdiff -u -p -r1.481 system.install[0;0m
[1;31m--- modules/system/system.install	25 Jun 2010 17:47:22 -0000	1.481[0;0m
[1;34m+++ modules/system/system.install	26 Jun 2010 07:25:31 -0000[0;0m
[1;35m@@ -1776,6 +1776,10 @@ function system_update_7004(&$sandbox) {[0;0m
[0;0m     ),[0;0m
[0;0m   );[0;0m
[0;0m [0;0m
[1;34m+  $moved_deltas = array([0;0m
[1;34m+    'user' => array('navigation' => 'system'),[0;0m
[1;34m+  );[0;0m
[1;34m+[0;0m
[0;0m   // Only run this the first time through the batch update.[0;0m
[0;0m   if (!isset($sandbox['progress'])) {[0;0m
[0;0m     // Rename forum module's block variables.[0;0m
[1;35m@@ -1791,7 +1795,7 @@ function system_update_7004(&$sandbox) {[0;0m
[0;0m     }[0;0m
[0;0m   }[0;0m
[0;0m [0;0m
[1;31m-  update_fix_d7_block_deltas($sandbox, $renamed_deltas);[0;0m
[1;34m+  update_fix_d7_block_deltas($sandbox, $renamed_deltas, $moved_deltas);[0;0m
[0;0m [0;0m
[0;0m }[0;0m
[0;0m [0;0m
[1;35m@@ -1850,14 +1854,14 @@ function system_update_7008() {[0;0m
[0;0m }[0;0m
[0;0m [0;0m
[0;0m /**[0;0m
[1;31m- * Rename the variables for primary and secondary links.[0;0m
[1;31m- *[0;0m
[1;34m+ * Rename the variable for primary links.[0;0m
[0;0m  */[0;0m
[0;0m function system_update_7009() {[0;0m
[1;31m-  db_update('variable')[0;0m
[1;31m-    ->fields(array('name' => 'main_menu_links_source'))[0;0m
[1;31m-    ->condition('name', 'menu_primary_links_source')[0;0m
[1;31m-    ->execute();[0;0m
[1;34m+  $current_primary = variable_get('menu_primary_links_source');[0;0m
[1;34m+  if (isset($current_primary)) {[0;0m
[1;34m+    variable_set('menu_main_links_source', $current_primary);[0;0m
[1;34m+    variable_del('menu_primary_links_source');[0;0m
[1;34m+  }[0;0m
[0;0m }[0;0m
[0;0m [0;0m
[0;0m /**[0;0m
[1;35m@@ -2426,15 +2430,6 @@ function system_update_7052() {[0;0m
[0;0m  * Upgrade standard blocks and menus.[0;0m
[0;0m  */[0;0m
[0;0m function system_update_7053() {[0;0m
[1;31m-  // Navigation block is now defined in system module.[0;0m
[1;31m-  if (db_table_exists('block')) {[0;0m
[1;31m-    db_update('block')[0;0m
[1;31m-      ->fields(array('module' => 'system'))[0;0m
[1;31m-      ->condition('module', 'user')[0;0m
[1;31m-      ->condition('delta', 'navigation')[0;0m
[1;31m-      ->execute();[0;0m
[1;31m-  }[0;0m
[1;31m-[0;0m
[0;0m   if (db_table_exists('menu_custom')) {[0;0m
[0;0m     // Create the same menus as in menu_install().[0;0m
[0;0m     db_insert('menu_custom')[0;0m
[1;35m@@ -2445,6 +2440,25 @@ function system_update_7053() {[0;0m
[0;0m       ->fields(array('menu_name' => 'management', 'title' => 'Management', 'description' => "The <em>Management</em> menu contains links for administrative tasks."))[0;0m
[0;0m       ->execute();[0;0m
[0;0m   }[0;0m
[1;34m+[0;0m
[1;34m+  block_flush_caches();[0;0m
[1;34m+[0;0m
[1;34m+  // Show the new menus on themes and places the navigation block is shown[0;0m
[1;34m+  $blocks = db_query("SELECT theme, status, region, weight, visibility, pages FROM {block} WHERE module = 'system' AND delta = 'navigation'");[0;0m
[1;34m+  foreach ($blocks as $block) {[0;0m
[1;34m+    db_update('block')[0;0m
[1;34m+      ->fields(array([0;0m
[1;34m+        'status' => $block->status,[0;0m
[1;34m+        'region' => $block->region,[0;0m
[1;34m+        'weight' => $block->weight,[0;0m
[1;34m+        'visibility' => $block->visibility,[0;0m
[1;34m+        'pages' => $block->pages,[0;0m
[1;34m+      ))[0;0m
[1;34m+      ->condition('theme', $block->theme)[0;0m
[1;34m+      ->condition('module', 'system')[0;0m
[1;34m+      ->condition(db_or()->condition('delta', 'user-menu')->condition('delta', 'management'))[0;0m
[1;34m+      ->execute();[0;0m
[1;34m+  }[0;0m
[0;0m }[0;0m
[0;0m [0;0m
[0;0m /**[0;0m
