line 55:
if (is_array($font)) {

$font value comes as a string, so this check is incorrect, should be like in 1.3:
if (!empty($font)) {
or simply
if ($font) {

CommentFileSizeAuthor
#7 878794.patch695 byteswebkenny

Comments

mudsurfer’s picture

WIth reference to my post http://drupal.org/node/877666
Tested this solution successfully, by modding line 55 in module file.
Thankyou TJ

AdrianB’s picture

The fix worked for me as well, thanks!

BarisW’s picture

Just a small note. It was if (!empty($font)) { in version 1.3.
I changed this to is_array because as of 1.3, $font will return an array instead of a string.

This check helped me to fix the bug with the memory problem. If it returns an array, the uses saved the 1.3 or 1.4 version successfully. If not, he still uses the old font declaration. Changing this to if ($font) { works for those who use the 1.3 version. Those who saved their settings with 1.2 and then upgraded to 1.3 (with if ($font) { instead of if (is_array($font)) { will probably get the memory error again.

The problem is that I didn't test with only one enabled font. I guess enabling two fonts will also solve your problem?

AdrianB’s picture

Enabling two (or more) fonts would not solve my problem. Only when I change to if (!empty($font)) { I get fonts display on other pages than Google Fonts setting page. This is on a site that previously ran 1.2 (but couldn't run 1.3 due to the memory issue).

On my other test site, where I've never used 1.2, only 1.3, I still have the same problem after updating to 1.4. Only when I change to if (!empty($font)) { I get fonts display on other pages than Google Fonts setting page, just like my first site.

mudsurfer’s picture

Enabling two or more fonts did not work for me either.
I originally had a number of fonts installed for testing and that was where I noticed my problems.
So sorry, multiple fonts activated is not a solution that works for me.
Cheers.

webkenny’s picture

Title: wrong variable check in google_fonts_init() » Google Fonts do not display on any page but administrative. Wrong check in google_fonts_init()
Assigned: Unassigned » webkenny

I will roll a patch for this since it doesn't work for me either (even enabling more than two). Assigning to myself, Boris. Also changed the topic to be more clear for Google Searches.

webkenny’s picture

Status: Active » Needs review
StatusFileSize
new695 bytes

This one does it. I went with the empty approach simply because it feels more flexible.

BarisW’s picture

Status: Needs review » Fixed

Thanks! Committed to 6.x-1.dev.

BarisW’s picture

Added to 6.x-1.5.

Thanks again ;)

Status: Fixed » Closed (fixed)

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

gooddesignusa’s picture

The font "Droid Serif" isn't working in ie8. I haven't checked ie6,ie7,chrome or opera. I'm running the latest recommended version.

gooddesignusa’s picture

Status: Closed (fixed) » Needs work
AdrianB’s picture

Status: Needs work » Fixed

gooddesignusa: I think you need to open a separate issue about that. This issue is about "Google Fonts do not display on any page but administrative. Wrong check in google_fonts_init()" and it is fixed.

AdrianB’s picture

Status: Fixed » Closed (fixed)