Call to undefined function fb_settings() in ...fb.module on line line 513 (with 3.0-rc3 it ws in line 476 )

fb_settings() being defined in fb-settings.inc file
- so the include file is not being loaded via Update.php

stopping me from running updates

the update isnt for fb so i'll drop mod and update then put mod back in, as a workaround, but this could really get in someones way

Comments

Dave Cohen’s picture

Title: Cannot run Update with FB - Call to undefined function » undefined function fb_settings() when running update.php
Assigned: Unassigned » Dave Cohen
Issue tags: +fb3-blocker

thanks for the report. Usually I include sites/all/modules/fb/fb_settings.inc in my site's settings.php, so I haven't seen this before. I recommend that as a workaround.

Dave Cohen’s picture

Do you know which update is trying to run when this happens?

shunshifu’s picture

I run into this issue also. It happens during any update. I turn of the FB module. Run the update. and turn it back on.

Your workaround of adding
include_once './sites/all/modules/fb/fb_settings.inc';

to settings.php worked great

Thanks

Phil

Dave Cohen’s picture

Version: 6.x-3.0-rc5 » 6.x-3.x-dev
Assigned: Dave Cohen » Unassigned
Status: Active » Needs review
StatusFileSize
new443 bytes

Here's the fix, I think.

jeseich’s picture

I used the patch from Dave Cohen and that seemed to fix my problem running update.php. Thanks!

Dave Cohen’s picture

Status: Needs review » Fixed

This was checked in but issue status never updated.

Status: Fixed » Closed (fixed)

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

jonhattan’s picture

Title: undefined function fb_settings() when running update.php » undefined function fb_settings() when running update.php or installed from an install profile.
Version: 6.x-3.x-dev » 7.x-3.x-dev
Status: Closed (fixed) » Active

I've added this module to a install profile. At the very end of installation I obtain

An AJAX HTTP error occurred. HTTP Result Code: 200 Debugging information follows. Path: http://urtest/install.php?profile=ur&locale=en&id=1&op=do StatusText: OK ResponseText: Fatal error: Call to undefined function fb_settings() in /var/www/urtest/profiles/ur/modules/fb/fb.module on line 657

The fix above seems not useful at install time.

jonhattan’s picture

Status: Active » Needs review
Issue tags: -fb3-blocker
StatusFileSize
new682 bytes

Fixed with attached patch. Perhaps worth it to use hook_boot() instead of all of this.

jonhattan’s picture

StatusFileSize
new665 bytes

with better docs.

Dave Cohen’s picture

Status: Needs review » Needs work

Well, that's kind of crappy of drupal to not always call that hook.

I'd rather do something like this in fb_init()

if (!function_exists('fb_settings')) {
  // This may be reached during installation, when hook_custom_theme() is not called.
  fb_custom_theme();
}

That will lead to less duplicated code between fb_init() and fb_custom_theme(). Can you confirm that works as well?

jonhattan’s picture

Status: Needs work » Needs review
StatusFileSize
new1.2 KB

Yes it works at install time. Not sure if it is also fine for update.php. Patch attached.

mrfelton’s picture

Patch at #12 works for me, thanks.

mrfelton’s picture

Although, fb_devel module has the same problem.

fluffy’s picture

patch at #12 worked for me too

Dave Cohen’s picture

Status: Needs review » Reviewed & tested by the community

Planning to push this shortly. Thanks all.

Dave Cohen’s picture

Status: Reviewed & tested by the community » Closed (duplicate)

Sorry, I got lost in duplicate issues. Fixed under #1182190: hook_custom_theme sometimes isn't called resulting in fatal error