update.php fatal error in views_bulk_operations_update_6000()

mfb - July 2, 2009 - 23:05
Project:Views Bulk Operations (VBO)
Version:6.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed
Description

Fatal error: Call to undefined function views_bulk_operations_get_object_info()

AttachmentSize
vbo.patch813 bytes

#1

infojunkie - July 3, 2009 - 01:01

I'm surprised that it can't find this function whereas it doesn't complain about views_get_all_views for example. Also, I didn't get this fatal error when I tested again hook_update_6000 on my side. Is there a setting for update.php that unloads modules before it runs? Was VBO being throttled?

#2

mfb - July 4, 2009 - 00:56

The issue is that (oddly) Drupal 6 update.php upgrades all modules regardless of whether or not they're enabled. So update scripts need to call drupal_load() to make sure any functions they call are available in case the module is disabled.

You can see various contrib modules do this such as cck content.install

#3

infojunkie - July 4, 2009 - 02:25
Status:needs review» fixed

Thanks for clarifying. I was able to reproduce the error by disabling VBO before running the update. I added a call to drupal_load('module', 'views') since I'm calling Views functions in hook_update_6000.

I committed the fix to the latest dev.

#4

scottrigby - July 17, 2009 - 15:49
Status:fixed» active

Hi guys,
I saw a related error today. Based on this issue, I tried to update an existing site from 6.x-1.5 to the latest dev (checked out from CVS today). Ideally i'd like to keep my VBO views, otherwise I'd just uninstall & reinstall fresh. Any advice?

Here's the error:

Updating

An unrecoverable error has occurred. You can find the error message below. It is advised to copy it to the clipboard for reference.
Please continue to the error page

An error occurred. http://phustage.dlcdev.com/update.php?id=33&op=do <br /> <b>Fatal error</b>: Call to undefined function views_bulk_operations_get_object_info() in <b>/usr/local/webapp/phustage.dlcdev.com/sites/all/modules/views_bulk_operations/views_bulk_operations.install</b> on line <b>20</b><br />

#5

infojunkie - July 17, 2009 - 22:02
Status:active» fixed

I introduced a regression when I changed the name of a function. Fixed now. Sorry!

#6

scottrigby - July 19, 2009 - 12:37

cool - thanks kratib ;)

#7

System Message - August 2, 2009 - 12:40
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.