summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwebchick <webchick@24967.no-reply.drupal.org>2012-08-26 10:40:05 -0700
committerwebchick <webchick@24967.no-reply.drupal.org>2012-08-26 10:40:05 -0700
commitfe87f404c11f7db18781fa885a77f7c93b90cf2a (patch)
treeae047419de0d0f272e4c8a625b14ac9dc001a707
parent5ddd5d38393ac60f12a418526d8ab53c56a49ba6 (diff)
downloadbrdo-fe87f404c11f7db18781fa885a77f7c93b90cf2a.tar.gz
brdo-fe87f404c11f7db18781fa885a77f7c93b90cf2a.tar.bz2
Issue #1613554 by drumm, BTMash: Fixed Update menu link queries from 6's strings.
-rw-r--r--modules/simpletest/tests/upgrade/drupal-6.menu.database.php27
-rw-r--r--modules/system/system.install22
2 files changed, 49 insertions, 0 deletions
diff --git a/modules/simpletest/tests/upgrade/drupal-6.menu.database.php b/modules/simpletest/tests/upgrade/drupal-6.menu.database.php
index 8962615fb..7fae337aa 100644
--- a/modules/simpletest/tests/upgrade/drupal-6.menu.database.php
+++ b/modules/simpletest/tests/upgrade/drupal-6.menu.database.php
@@ -126,6 +126,33 @@ db_insert('menu_links')->fields(array(
'p9' => '0',
'updated' => '0',
))
+->values(array(
+ 'menu_name' => 'secondary-links',
+ 'mlid' => '206',
+ 'plid' => '0',
+ 'link_path' => 'node',
+ 'router_path' => 'node',
+ 'link_title' => 'node-page-with-query',
+ 'options' => 'a:2:{s:5:"query";s:14:"page=1&node=10";s:10:"attributes";a:1:{s:5:"title";s:0:"";}}',
+ 'module' => 'menu',
+ 'hidden' => '0',
+ 'external' => '0',
+ 'has_children' => '0',
+ 'expanded' => '0',
+ 'weight' => '2',
+ 'depth' => '1',
+ 'customized' => '1',
+ 'p1' => '206',
+ 'p2' => '0',
+ 'p3' => '0',
+ 'p4' => '0',
+ 'p5' => '0',
+ 'p6' => '0',
+ 'p7' => '0',
+ 'p8' => '0',
+ 'p9' => '0',
+ 'updated' => '0',
+))
->execute();
db_insert('blocks')->fields(array(
'bid',
diff --git a/modules/system/system.install b/modules/system/system.install
index 58a4f8e98..4f85dc928 100644
--- a/modules/system/system.install
+++ b/modules/system/system.install
@@ -3053,6 +3053,28 @@ function system_update_7075() {
}
/**
+ * Convert menu_links query strings into arrays.
+ */
+function system_update_7076() {
+ $query = db_select('menu_links', 'ml', array('fetch' => PDO::FETCH_ASSOC))
+ ->fields('ml', array('mlid', 'options'));
+ foreach ($query->execute() as $menu_link) {
+ if (strpos($menu_link['options'], 'query') !== FALSE) {
+ $menu_link['options'] = unserialize($menu_link['options']);
+ if (isset($menu_link['options']['query']) && is_string($menu_link['options']['query'])) {
+ $menu_link['options']['query'] = drupal_get_query_array($menu_link['options']['query']);
+ db_update('menu_links')
+ ->fields(array(
+ 'options' => serialize($menu_link['options']),
+ ))
+ ->condition('mlid', $menu_link['mlid'], '=')
+ ->execute();
+ }
+ }
+ }
+}
+
+/**
* @} End of "defgroup updates-7.x-extra".
* The next series of updates should start at 8000.
*/