From 1cab1dee606e5c62e3591c062827a8602f39bb72 Mon Sep 17 00:00:00 2001 From: Dries Buytaert <dries@buytaert.net> Date: Sat, 14 Jan 2006 10:22:26 +0000 Subject: [PATCH] - Patch #41594 by Richard: more improvements to primary/secondary links upgrade path. --- database/updates.inc | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/database/updates.inc b/database/updates.inc index 7b727f60a32e..a79edcea1861 100644 --- a/database/updates.inc +++ b/database/updates.inc @@ -938,7 +938,13 @@ function system_update_151() { // Gather links from various settings into a single array. $phptemplate_links = variable_get("phptemplate_". $menus[$loop]['links_var'], array()); + if (!is_array($phptemplate_links)) { + $phptemplate_links = array(); + } $phptemplate_links_more = variable_get("phptemplate_". $menus[$loop]['links_var'] ."_more", array()); + if (!is_array($phptemplate_links_more)) { + $phptemplate_links_more = array(); + } if (isset($ts) && is_array($ts)) { if (is_array($ts[$menus[$loop]['links_var']])) { $theme_links = $ts[$menus[$loop]['links_var']]; @@ -980,8 +986,10 @@ function system_update_151() { db_query("DELETE FROM {menu} WHERE mid={$menus[$loop]['pid']}"); } - // set menu_primary_menu variable appropriately - if (!$ts[$menus[$loop]['toggle_var']] || $num_inserted == 0) { + // Set menu_primary_menu and menu_primary_menu variables if links were + // imported. If the user had links but the toggle display was off, they + // will need to disable the new links manually in admins/settings/menu. + if ($num_inserted == 0) { variable_set($menus[$loop]['menu_var'], 0); } else { -- GitLab