Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I'm having an issue using Fontdeck on a domain with a www prefix. I have added both www and non-www version to my Fontdeck configuration. For one reason or another, beyond my control, the Drupal site is only available on the www domain. What I'm wondering is why on earth fontdeck_get_domain() makes an assumption that it's ok to strip www? I have found that changing that single line of code fixes my problem, but submitting this as a support request because I'm not sure if there is a good reason for it.
Comment | File | Size | Author |
---|---|---|---|
#2 | fontyourface-1891820-2-dont-strip-www.patch | 829 bytes | mstrelan |
Comments
Comment #1
sreynen CreditAttribution: sreynen commentedGood question. I can't find any documentation on this, but I think maybe when we were initially testing the API, it would only match on non-www domains. If that's not the case now, we should change the code.
Comment #2
mstrelan CreditAttribution: mstrelan commentedPatch
Comment #3
Drave Robber CreditAttribution: Drave Robber commentedAccording to http://fontdeck.com/support/troubleshooting,
So it definitely "thinks" www and non-www are different. Obviously, it also checks the referrer and is quite strict about it.
The patch looks good (hey, it also fixes that silly typo in the comment above :); unfortunately, I have no capability to test it properly at the moment.
Comment #4
Drave Robber CreditAttribution: Drave Robber commentedI set up
www.fyf.local
in addition tofyf.local
, added both as domains to my Fontdeck project, enabled one font, and hey - it works onwww.fyf.local
even though requested viahttp://f.fontdeck.com/s/css/hiLWjqcm3fXPpBf3PaBeLgn8Dis/fyf.local/29429.css
. So the important part is adding www. domain to the Fontdeck project, but the domain in request URL isn't really important.Not all fonts work, though - some (not to say half of them) refuse to work altogether. I reckon some API information might be outdated. At the moment, I'm not sure what to do about this.Not "outdated", but "not updated instantly", and it seems to take wildly different time to update (from 10 sec to 5 min) - got me confused.Still not sure what to do next and whether there is anything in need of a fix. More testing, esp. on real domains, welcome.
Comment #5
Drave Robber CreditAttribution: Drave Robber commentedOn the other hand, this patch might be justified simply on "don't do redundant stuff" grounds. I'm inclined to leave this hanging while other Fontdeck issues are solved (see below).
The real reason why Fontdeck acts up with multiple domains seems to be altogether different.
fontdeck_fontyourface_import()
adds CSS only for the domain you're currently on, which is not always appropriate. Until we've figured out what to do about this, you're left with somewhat silly option of repeating 'Import Fontdeck fonts' on every domain.Comment #6
Neslee Canil Pinto