Since last week I get the following errors when trying to update the typekit fonts:

Notice: Undefined property: stdClass::$foundry in typekit_api_fontyourface_import() (line 69 of /home/patrickd/www/drupal7/sites/default/modules/fontyourface/modules/typekit_api/typekit_api.module).
Notice: Trying to get property of non-object in typekit_api_fontyourface_import() (line 69 of /home/patrickd/www/drupal7/sites/default/modules/fontyourface/modules/typekit_api/typekit_api.module).

This seems to me like typekit changed their api and told nobody..

Quick fix:
Changing in the fontyourface_font table:
Column: css_selector, Value: NULL, Change to <none>

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

patrickd’s picture

Version: 7.x-2.4 » 7.x-2.x-dev
Status: Active » Needs review
FileSize
2.19 KB

following patch resolves this issue for me

- checks whether there's a foundry property in the returned data
- makes sure that <none> is set as css selector by default

patrickd’s picture

Oops, removed some documentation.

rerolled against current 7.x-2.x

Drave Robber’s picture

Typekit has indeed made some changes: http://blog.typekit.com/2012/08/16/performance-improvements-to-font-serv...
They're saying "You don’t need to do anything" but I'm not so sure and well, they may be right after all.

For me, Typekit silently fails to import anything at the moment. (this was due to recent changes in my local setup, so totally unrelated)

I successfully updated my two fonts in a trial library; could it be that this is related to some specific font that's missing foundry name?

sreynen’s picture

Status: Needs review » Needs work

This patch appears to have two changes: 1) adding a conditional check around setting the foundry info, and 2) Changing NULL to <none>. #1 seems good to me. I don't understand why #2 is there. Changing the selector from NULL to <none> means the fonts get loaded, but they're still not applied by the module. Are you applying Typekit fonts some other way? In any case, #2 seems like it should be a separate issue, unless I'm just completely missing the connection to #1.

patrickd’s picture

As far I could see the service returned <none> at first, but now returns NULL instead. #2 just fixes this change

I have pretty much no idea why the api changed this way, I also could not find any documentation about the change itself.
I just encountered the issue and this patch seemed to be the only way to get it working again.

As far I can see #1, as well as #2 are necessary to make the module work with typekit correctly again, therefore I'd keep them in this issue.

sagannotcarl’s picture

Issue summary: View changes
Status: Needs work » Reviewed & tested by the community

The patch in #2 works for me.

Neslee Canil Pinto’s picture

Status: Reviewed & tested by the community » Closed (outdated)