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

Command icon 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:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Diffe1964 created an issue. See original summary.

Diffe1964’s picture

Here the suggested patch to solve the issue

hondaman900’s picture

I 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).

Google API not working in font-your-face module

bgm’s picture

Status: Needs review » Reviewed & tested by the community

Patch #2 works for me

urvashi_vora made their first commit to this issue’s fork.

urvashi_vora’s picture

Patch #2 worked perfectly fine.

LGTM

RTBC++

Committing the changes to help the maintainer.

Neslee Canil Pinto made their first commit to this issue’s fork.

Neslee Canil Pinto’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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