With only the following installed on a fresh Drupal 7.17 site:

  • @font-your-face 7.x-2.6
  • @font-your-face UI 7.x-2.6
  • fonts.com 7.x-2.6
  • Views 7.x-3.5

I am getting a HTTP Error 500 when I try to 'enable some fonts' from /admin/appearance/fontyourface.

The URL that is attempted is:
/admin/appearance/fontyourface/browse/fonts_com

Comments

Drave Robber’s picture

Does anything appear in the Apache error log (e.g. /var/log/apache2/error.log on Linux)?

What is your PHP memory limit (see Reports > Status report for this)?

It could be as simple as Views crashing due to insufficient memory, although more details could of course prove me wrong.

rajmataj’s picture

Thanks for your quick response. To answer your questions:

Oddly enough, there is no error logged for the blank page. I've tried again by clearing the log, then going to /admin/appearance/fontyourface, then selecting the 'Browse all fonts' button which shows a rollover link as /admin/appearance/fontyourface/browse. This brings up a blank page with the url admin/appearance/fontyourface/browse/fonts_com

PHP memory limit: 128M

Now, if I enable Google Fonts as a choice for @font-your-face then the two first links up above work as expected. I've tried disabling and uninstalling all the @font-your-face modules then re-enabling just the basics as mentioned in my initial post above but to no avail.

Drave Robber’s picture

Assigned: Unassigned » Drave Robber

I think I reproduced this.

The error behind this seems to be something like:
[Tue Dec 04 23:44:46 2012] [error] [client 127.0.0.1] PHP Fatal error: Unsupported operand types in /var/www/fyf/includes/common.inc on line 820, referer: http://fyf.local/
...which means something, somewhere is calling drupal_http_request() incorrectly, with the second argument not being an array being an array that cannot be merged properly.

Continuing investigation.

Drave Robber’s picture

This may happen if fonts.com is not configured at /admin/config/user-interface/fontyourface/fonts_com and authentication token is missing.

Drave Robber’s picture

Title: HTTP Error 500 with fonts.com » Fix HTTP Error 500 with fonts.com
Assigned: Drave Robber » Unassigned
Status: Active » Needs review
StatusFileSize
new758 bytes

And here's a patch that would let it avoid crashing and get on to displaying other error messages (which perhaps could be more informative, but one thing at a time).

nrambeck’s picture

I ran into this same problem. This fatal error occurs when attempting to first configure fontyourface and there is not way to navigate to the token configuration for Font.com otherwise. The patch #5 does resolve the problem by at least providing a meaningful error "There was an error importing the font count from Fonts.com."

I would suggest including an additional linked message in the error pointing users to the fonts.com token configuration page as a possible solution.

Drave Robber’s picture

Here's an additional patch to point error messages (those that could expected to happen because of lacking token) to the configuration page.

(Yesterday it was already well past midnight at my place, so I wanted to solve at least the more critical issue before heading to bed :)

Status: Needs review » Needs work
Drave Robber’s picture

Huh?

Perhaps file name mismatch - I crashed and had to attach the patch once again.

Another try...

Drave Robber’s picture

Status: Needs work » Needs review

Bot?

Status: Needs review » Needs work
Drave Robber’s picture

Status: Needs work » Needs review
StatusFileSize
new3.76 KB

That was an extremely stupid mistake on my part. (I tried to patch it on top of #1845672: Improve readability of debugging info)

Re-rolled against HEAD.

Sorry about the whole mess.

robmc’s picture

Hi Drave Robber,

Thank you! Both patches (#5 and #12) applied perfectly and work as I would expect.

Cheers,

Rob

ahimsauzi’s picture

Is #5 and #12 patches solve the issue or just print more informative messages?

Edit: looked at the patches and it seems to be a way to debug the issue. Rolled back to 7.x-2.5 which works fine.
Thanks!

robmc’s picture

Hi @ahimsauzi,

Not sure what you mean? Patch #5 corrects the root cause of the 500 error and patch #12 gives you a good link on completing the configuration so you can access fonts.com fonts.

In other words, if you apply both you'll have a complete fix for the issue.

Cheers,

Rob

ahimsauzi’s picture

Hi Rob,

Thanks for the clarification. The error I received was similar to #3 and prevented me from reaching admin/config/user-interface/fontyourface/fonts_com to enter my fonts.com token on a fresh install. After I rolled back to 7.x-2.5 and added my font.com token I upgraded to 7.x-2.6 with no error (most likely since the token was already on the db). I applied the patches as well and all is good.

Cheers,

Uzi

Drave Robber’s picture

Title: Fix HTTP Error 500 with fonts.com » Point fonts.com error messages to the configuration page
Version: 7.x-2.6 » 7.x-2.x-dev
Category: bug » feature
Priority: Major » Normal

#5 has been committed to -dev.

#12 is rather a feature request and could use a separate review. :)

robmc’s picture

Hi Drave Robber,

#12 worked great I'm happy to confirm. Or, did you want this as a new issue? I'd be happy to confirm there too ;-)

Best Regards,

Rob

BarisW’s picture

Status: Needs review » Needs work

Drave: thanks for committing. The 'configuration' strings miss a t() wrapper though. New issue of fix it here?

Drave Robber’s picture

Status: Needs work » Needs review
StatusFileSize
new3.78 KB

BarisW: indeed. A new patch attached.

(this isn't committed yet, only #5 was committed)

(note to self: two different patches in one issue is not a good idea, don't do that again :)

BarisW’s picture

Status: Needs review » Reviewed & tested by the community

Looks good. thanks!

Drave Robber’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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