-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Avoid creating font families without font faces. #59436
Avoid creating font families without font faces. #59436
Conversation
If we ae trying to create a new font family with font faces but the font family was created in the database but the font faces failed because of the file system permissions, the font family is removed from the database.
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Size Change: +30 B (0%) Total Size: 1.71 MB
ℹ️ View Unchanged
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code changes LGTM and works as described following the test instructions 👍
@matiasbenedetto Do you want to backport this to the WP beta? |
Yes, I added the corresponding label. Thanks for asking. |
If we ae trying to create a new font family with font faces but the font family was created in the database but the font faces failed because of the file system permissions, the font family is removed from the database. --- Co-authored-by: matiasbenedetto <mmaattiiaass@git.wordpress.org> Co-authored-by: mikachan <mikachan@git.wordpress.org>
I just cherry-picked this PR to the update/packages-6.5-rc1 branch to get it included in the next release: 6c04972 |
If we ae trying to create a new font family with font faces but the font family was created in the database but the font faces failed because of the file system permissions, the font family is removed from the database. --- Co-authored-by: matiasbenedetto <mmaattiiaass@git.wordpress.org> Co-authored-by: mikachan <mikachan@git.wordpress.org>
What?
Avoid creating font families without font faces.
Why?
There could be cases where the user can create font families but no font faces. For example, the user could be able to have permission to create font families in the database, but the filesystem permissions could be wrong in their server. This could lead to font families without any font face.
There are explorations around hiding the install-related UI when the user doesn't have permission to write the fonts folder. Those explorations haven't landed yet; this safe-guard probably won't hurt when those changes land and may still be useful in some cases, such as uploading font faces with wrong mime types.
How?
With this change, if the user is installing a font family but the installation of all font faces failed, the font family just created is removed from the database.
Testing Instructions
wp-content/fonts
folder.Screenshots or screencast
The screencasts are feature installing fonts in 2 scenarios:
Compare the behavior in
trunk
2024-02-28.14-34-15.mp4
vs the be behavior in this branch:
2024-02-28.14-36-20.mp4