Running update.php when I upgrade from version 6.x-3.5 to 6.x-4.x-dev (2009-Nov-07), gives me the following error:

An error occurred. http://localhost/drupal/update.php?id=184&op=do <br /> <b>Fatal error</b>: Call to undefined function drupal_theme_rebuild() in <b>C:\wamp\www\drupal\sites\all\modules\dhtml_menu\dhtml_menu.install</b> on line <b>145</b><br />

Should I uninstall 3.5 before I install 4.x-dev?

Comments

tomsm’s picture

If I uninstall version 3.5 first, the installation of 6.x-4.x-dev works fine.

janusman’s picture

Same here. Doing a clean install works fine, update doesn't =)

rpsu’s picture

There is nothing to uninstall with 6.x-3.5 (using /admin/build/modules/uninstall) so when you say "clean install" did you manage to install 6.x-4.x-dev on the same Drupal with previous version?

I tried to update 6.x-3.5 -> 6.x.4.x-dev with no success. I unselected DHTL module on admin/build/modules -page before updating dhtml-module (files) on server but still having the same issue.

tomsm’s picture

First, you have to disable the module, then you can uninstall it, I think. If there is nothing to uninstall, you can remove the module from your modules folder. Then install the new version.

rpsu’s picture

Thanks, I did. There were nothing to uninstall after I disabled dhtml-module and I was thinking if 6.x-4.x-dev -version needs to be installed on a fresh Drupal.

h0tw1r3’s picture

Looks like the Drupal 7 function is being called. This patch fixes the error.

--- dhtml_menu.install~ 2009-11-06 18:13:52.000000000 -0600
+++ dhtml_menu.install  2010-01-04 23:53:02.197223556 -0600
@@ -142,7 +142,7 @@
   variable_del('dhtml_menu_theme_menu_item');
   variable_del('dhtml_menu_theme_menu_item_link');

-  drupal_theme_rebuild();
+  drupal_rebuild_theme_registry();
   return array();
 }

Once that function call is fixed, then you will get:

warning: Missing argument 2 for variable_get(), called in sites/all/modules/dhtml_menu/dhtml_menu.install on line 184 and defined in includes/bootstrap.inc on line 503.

Which i believe is fixed by:

--- dhtml_menu.install~ 2010-01-04 23:53:02.197223556 -0600
+++ dhtml_menu.install  2010-01-04 23:57:11.320932505 -0600
@@ -181,7 +181,7 @@
  * #7103: Rename "pseudo-child" to "clone".
  */
 function dhtml_menu_update_7103() {
-  $settings = variable_get('dhtml_menu_settings');
+  $settings = variable_get('dhtml_menu_settings', array());
   if ($settings['nav'] == 'pseudo-child') {
     $settings['nav'] = 'clone';
     variable_set('dhtml_menu_settings', $settings);
h0tw1r3’s picture

Status: Active » Needs review
saloob’s picture

Than you guys! Champions!

bobby endarr ramdin’s picture

Yo, h0tw1r3

Thanks for the patch, works great!!!

Peace
E

vuil’s picture

Issue summary: View changes
Status: Needs review » Closed (outdated)

I close the issue as Closed (outdated) because drupal_theme_rebuild() does not exist anymore. Thank you!