From 0269a7893615b05a9323cde6b70d3a0c31c4d6ff Mon Sep 17 00:00:00 2001
From: Gerhard Killesreiter <killes_www_drop_org@227.no-reply.drupal.org>
Date: Fri, 28 Apr 2006 13:00:23 +0000
Subject: [PATCH] #41594, make upgrade more robust for 4.6 phptemplate users,
 patch by tenrapid

---
 database/updates.inc | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/database/updates.inc b/database/updates.inc
index 5d65503cd615..df676513c453 100644
--- a/database/updates.inc
+++ b/database/updates.inc
@@ -946,12 +946,8 @@ 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 (empty($phptemplate_links)) {
+      $phptemplate_links = array('text' => array(), 'link' => array());
     }
     if (isset($ts) && is_array($ts)) {
       if (is_array($ts[$menus[$loop]['links_var']])) {
@@ -965,9 +961,10 @@ function system_update_151() {
       }
     }
     else {
-      $theme_links = array();
+      $theme_links = array('text' => array(), 'link' => array());
     }
-    $links = array_merge($phptemplate_links, $phptemplate_links_more, $theme_links);
+    $links['text'] = array_merge($phptemplate_links['text'], $theme_links['text']);
+    $links['link'] = array_merge($phptemplate_links['link'], $theme_links['link']);
 
     // insert all entries from theme links into new menus
     $num_inserted = 0;
-- 
GitLab