diff options
author | David Rothstein <drothstein@gmail.com> | 2012-07-29 23:15:33 -0400 |
---|---|---|
committer | David Rothstein <drothstein@gmail.com> | 2012-07-29 23:15:33 -0400 |
commit | 99b25143b23cc72b9f1650b11406a07d96b034e9 (patch) | |
tree | 264f575a2d95ca85fb8aa41f08b8492a1c6b1fde /modules/system/system.install | |
parent | 1c2301b463881d7e8fe61677f6be642fed850d65 (diff) | |
download | brdo-99b25143b23cc72b9f1650b11406a07d96b034e9.tar.gz brdo-99b25143b23cc72b9f1650b11406a07d96b034e9.tar.bz2 |
Issue #1613554 by drumm, BTMash: Fixed Update menu link queries from 6's strings (followup to avoid use of API functions during updates).
Diffstat (limited to 'modules/system/system.install')
-rw-r--r-- | modules/system/system.install | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/modules/system/system.install b/modules/system/system.install index 800ea12e1..6d8142004 100644 --- a/modules/system/system.install +++ b/modules/system/system.install @@ -3019,15 +3019,19 @@ function system_update_7073() { * Convert menu_links query strings to arrays. */ function system_update_7074() { - $mlids = db_select('menu_links', 'ml') - ->fields('ml', array('mlid')) - ->condition('options', '%query%', 'LIKE') - ->execute()->fetchCol(); - foreach ($mlids as $mlid) { - $menu_link = menu_link_load($mlid); - if (is_string($menu_link['options']['query'])) { + $query = db_select('menu_links', 'ml', array('fetch' => PDO::FETCH_ASSOC)) + ->fields('ml', array('mlid', 'options')) + ->condition('options', '%query%', 'LIKE'); + foreach ($query->execute() as $menu_link) { + $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']); - menu_link_save($menu_link); + db_update('menu_links') + ->fields(array( + 'options' => serialize($menu_link['options']), + )) + ->condition('mlid', $menu_link['mlid'], '=') + ->execute(); } } } |