I installed and enabled the module version 6.x-2.0-beta4 (using drupal 6.22)

I setup a 404 error redirect at http://localhost/admin/settings/error-reporting

When I got to http://localhost/asdfasdf I get the following error:

Fatal error: Unsupported operand types in /includes/common.inc on line 1592

If i remove the module, the error is gone, and I get redirected to my 404 page.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

madhattertech’s picture

I also get the same issue with 6.x-2.0-beta3

Aress’s picture

I got the same issue with drupal 6.24 and 6.x-2.0-beta4.

webnotwar’s picture

Commenting out line 189 in fb_social.module ( $content = drupal_get_title(); , 6.x.2.0-beta4) fixes the problem for me.
Unfortunately, the "og:title" meta-tags doesnt' display the page title, just the site name.

function fb_social_init() {
  
  // Add simple OpenGraph metatags
  $data = "";
  if (variable_get('fb_social_opengraph', 1)) {
    // $content = drupal_get_title(); // comment out this line!
    $content = $content ? strip_tags($content) : variable_get('site_name', 'Drupal');
    //add fbml header meta information 
    ....
ferdi’s picture

I looked at this and was not able to find the source of this bug. Will investigate further.

Thanks!

Ionut’s picture

Any updates on this?

jsagotsky’s picture

The problem is in fact drupal_get_title. Running this in hook_init causes common.inc to WSOD. The short explanation is that drupal_get_title affects breadcrumb generation and implies that the current path should be part of the breadcrumb trail. When the breadcrumb trail is generated, that page has no title and causes the error.

Counterintuitively it looks like this can be fixed by swapping drupal_get_title out for drupal_set_title, which always returns the title but only sets a title if a new one is provided. drupal_get_title also sets the active title, which is what causes the breadcrumb error.

Patch to follow. This change does avoid the error, but I'm not 100% sure yet that ignoring the make active call in drupal_get_title is okay.

jsagotsky’s picture

Here's the patch I mentioned in comment 6.

jsagotsky’s picture

Committed that last patch too soon. Turns out it wasn't getting the title correctly after all.

Attached patch will fix it.

WiredEscape’s picture

v6x-2.0-beta4

Confirm that fix works but patch contains an error in line to be replaced.
The code used in module is :
$content = drupal_get_title();

not

$content = drupal_set_title();

as found in patch.

gp.mazzola’s picture

I have found this thread trying to figure out the issue happening onmy site.
For me the latest patch does not work. (I corrected it according to post #9)
It seems to work a first time, but then it does not work anymore on subsequent pages requests
I tried both witch cache enabled and disabled

myha’s picture

Patch in #8 works for 6x-2.0-beta4. Thanks a lot!

myha’s picture

Issue summary: View changes

added drupal version