I was excited to try this module to add more info to our FB Like buttons. When enabled, nodes that call this modules meta info is returning this error. Any ideas?

Fatal error: Call to undefined function mb_substr() in path/sites/all/modules/opengraph_meta/opengraph_meta.common.inc on line 127

Comments

erikandershed’s picture

Hi, I also have this problem..

Fatal error: Call to undefined function mb_substr() in /default/modules/opengraph_meta/opengraph_meta.common.inc on line 127

Please help

markchitty’s picture

essentially, PHP is missing the mbstring extension.

you can either, enable the mbstring extension in PHP, as outlined here:

http://uk.php.net/manual/en/mbstring.installation.php

or you can use 'substr' instead of 'mb_substr' (but only if you are running a site which does not use multibyte character encoding). change line 127 of opengraph_meta.common.inc to:

$ret[self::DESCRIPTION] = !empty($node->body) ? substr(strip_tags($node->body),0,200) : $node->title;

although this is less than ideal and the 'fix' will get wiped out if you ever upgrade your module.

m

mattwmc’s picture

nevermind, didn't have mb_string ticked in easy apache

hiddentao’s picture

Status: Active » Closed (works as designed)

Yep, this is due to the missing mbstring extension.

Anonymous’s picture

Version: 6.x-1.5 » 7.x-1.2
Status: Closed (works as designed) » Needs review

The module should actually use the function "drupal_substr()" instead of "mb_substr()", since drupal_substr automatically checks if the unicode library is installed and provides a fallback if the library is missing.

hiddentao’s picture

Status: Needs review » Fixed

Fixed in next release.

Status: Fixed » Closed (fixed)

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