Skip to content

Fonts Library: collection ID is undefined #58075

@afercia

Description

@afercia

Description

This appeaers to be a regression in trunk after #57735

#57735 changed the font collection id to slug, the changes were made mainly on the PHP side. However, it appears a few parts in the JavaScript side sill expect a colelction id that it may be now undefined.

Cc @matiasbenedetto

For example:

In the odal dialog markup the ID is still used for the google fonts tab and tabpanel, but it is now undefined:

Screenshot 2024-01-22 at 15 06 32

The id to be used in these components is expected to be default-font-collection.

More importantly:
I couldn't get the prompt to allow to install Google fonts to shohw. Only after reverting #57735 I was finally able to see the prompt. There is code in the JS implementation that still expects the default-font-collection ID while now it receives undefined.

Screenshot of the prompt to allow to install fonts from Google:

Screenshot 2024-01-22 at 15 00 20

Step-by-step reproduction instructions

  • Clear your browser local storage.
  • Go to Site editor > Styles > Typography
  • Open the fonts modal dialog by clicking the 'Aa' (sigh) icon button.
  • Observe the title of the third tab within the modal dialog is 'Google fonts'. Expected: to be 'Install fonts' and change to 'Google fonts' only after permission to install has been given by the user.
  • Observe the content of the third tab is the list of Google fonts: Expected: to be the prompt to allow installation.

Screenshots, screen recording, code snippet

No response

Environment info

No response

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions