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.
Problem/Motivation
Running a clean automated Drupal 9 installation with "google_fonts_api_key" set, the installation job triggers "Requests from referer \u003cempty\u003e are blocked." marking the job as unsuccessful.
This problem has already been reported by GrahamShepherd in the issue #3183601 comment #7
Steps to reproduce
Install google_fonts_api
Proposed resolution
Add the referer to the http request
Comment | File | Size | Author |
---|---|---|---|
#3 | Font-settings-Google-API.png | 95.01 KB | hondaman900 |
#2 | 0001-Issue-3201463-by-Diffe1964-adding-the-referer-to-the.patch | 547 bytes | Diffe1964 |
|
Issue fork fontyourface-3201463
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
Diffe1964 CreditAttribution: Diffe1964 commentedHere the suggested patch to solve the issue
Comment #3
hondaman900 CreditAttribution: hondaman900 as a volunteer commentedI added this to the closed "parent" issue (before I spotted that this child issue exists, confirming my assertion that this is not resolved)
I'm getting this same issue with a current D8 install (8.9.13) and current version @font-your-face (8.x-3.6). I am using a fresh Google Web Fonts Developer API which is confirmed enabled. This is supposed to be resolved and working via the merged patch in @font-your-face, but I'm getting the following error:
The list of Google Fonts could not be fetched. Verify that your server can connect to the Google servers (https://www.googleapis.com). Error: Client error: `GET https://www.googleapis.com/webfonts/v1/webfonts?key={my Google API Key here}` resulted in a `403 Forbidden` response: { "error": { "code": 403, "message": "Requests from referer \u003cempty\u003e are blocked.", "errors": [ (truncated...)
The log shows:
TypeError: Argument 1 passed to _google_fonts_api_convert_api_results() must be of the type array, bool given, called in /home/mywebsite.com/modules/fontyourface/modules/google_fonts_api/google_fonts_api.module on line 116 in _google_fonts_api_convert_api_results() (line 183 of /home/mywebsite.com/modules/fontyourface/modules/google_fonts_api/google_fonts_api.module)
I am entering the Google API into the module's config page and the top error appears as soon as that API is saved ("save configuration" button).
Comment #4
bgm CreditAttribution: bgm at Coop SymbioTIC commentedPatch #2 works for me
Comment #6
urvashi_vora CreditAttribution: urvashi_vora at Valuebound for Valuebound commentedPatch #2 worked perfectly fine.
LGTM
RTBC++
Committing the changes to help the maintainer.
Comment #10
Neslee Canil Pinto