If an Bug on Fonts.com module of font your Face.

Fatal error: Unsupported operand types in ..../sites/all/modules/fontyourface/modules/fonts_com/fonts_com.module on line 1372

This error comes to select ..../admin/appearance/fontyourface

Greets Lennard

Comments

Lennard’s picture

Priority: Normal » Critical
sreynen’s picture

Version: 7.x-2.0 » 7.x-2.x-dev
Component: Code (general) » Fonts.com (provider)
Priority: Critical » Normal
Status: Needs work » Needs review

This looks like it's probably caused by a failure to connect to the Fonts.com API for some reason, so it's probably not happening reliably. I just made a change to the 7.x-2.x-dev version to prevent this error even when the Fonts.com API is down, so if you are still seeing it, please try the dev version and see if that fixes it for you.

Also, please read and use the Drupal.org Priority guidelines. This is the second issue you've marked as critical, apparently because it's critical for you personally. The priority field is for priority for the module, not for individual people. This falls under the definition of normal priority: "Bugs that affect one piece of functionality are normal priority."

Lennard’s picture

Sorry for used that as critical. Thank for your Informations.

johnpitcairn’s picture

I am also getting this error when attempting to access /admin/appearance/fontyourface/browse/fonts_com. I'm using 7.x-2.0. There is also an error message:

"There was an error getting filter choices from Fonts.com."

The fonts.com API is not down, I can include their stylesheets in template.php.

sreynen’s picture

John Pitcairn, please try the 2.x-dev version and see if that makes the error go away.

johnpitcairn’s picture

Actually I think I'll just uninstall and add fonts.com stylesheets in template.php. Apologies for the noise.

sreynen’s picture

Status: Needs review » Fixed

Alright, I don't think anyone is going to review this, so I'm marking it as fixed.

Status: Fixed » Closed (fixed)

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

robmc’s picture

Hi Scott,

I did test the dev version. This issue still remains or at least one that is identical. The steps I did to cause the issue were: fresh install of latest drupal (7.18 in this instance) installed and enabled Omega, Omega Tools, context, delta, views, fontyourface and fonts_com. Then browsed to /admin/appearance/fontyourface/browse/fonts_com and got a WSOD. In the apache/php error logs I got the reported issue.

I used a debugger to track down the issue to:

function fonts_com_api_headers($path) {

  $fonts_com_token = variable_get('fonts_com_token', '');

  if (empty($fonts_com_token)) {
    return;
  } // if

  list($public_key, $private_key) = explode('--', $fonts_com_token);

  $encoded = base64_encode(hash_hmac('md5', $public_key . '|' . $path, $private_key, TRUE));
  $auth = urlencode($public_key . ':' . $encoded);

  return array('Authorization' => $auth, 'AppKey' => FONTS_COM_API_APP_KEY);

} // fonts_com_api_headers

I was never prompted or found a way to set fonts_com_token through the UI or during install. This results in the Header element being undefined during the drupal_http_request call. The specific issue arises in drupal_http_request while attempting to += more header options.

I'm hoping this is a quick fix for you ;-) if it's not let me know and I'll dig in and put together a patch.

Cheer,

Rob McCrea

robmc’s picture

Assigned: Lennard » Unassigned
Status: Closed (fixed) » Active

Setting back to active.

Drave Robber’s picture

@robmc: the fix is out there and needs review - please see the patch in #5 of #1857404: Point fonts.com error messages to the configuration page.

robmc’s picture

Status: Active » Closed (fixed)

Thanks! I hadn't spotted that one. I'll move to that thread.

robmc’s picture

Issue summary: View changes

Giv more Information to fix