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 could not quite reproduce this; got a different sort of abnormal behavior though:
Notice: Undefined index: path in local_fonts_delete_font() (line 412 of /var/www/fyf/sites/default/modules/fontyourface/modules/local_fonts/local_fonts.module).
Warning: scandir(): Directory name cannot be empty in local_fonts_delete_font() (line 416 of /var/www/fyf/sites/default/modules/fontyourface/modules/local_fonts/local_fonts.module).
Warning: Invalid argument supplied for foreach() in local_fonts_delete_font() (line 418 of /var/www/fyf/sites/default/modules/fontyourface/modules/local_fonts/local_fonts.module).
Warning: rmdir(): No such file or directory in local_fonts_delete_font() (line 428 of /var/www/fyf/sites/default/modules/fontyourface/modules/local_fonts/local_fonts.module).
(trying to delete a Typekit font; obviously, Local Fonts module should not interfere here)
I more or less figured this out. 'Delete font record' belongs to Local Fonts module (and only local fonts are meant to be deleted this way); however, the button is displayed for all fonts, and trying to delete a Google font can lead to files in the root folder being deleted:
Warning: unlink(./.htaccess): Permission denied in local_fonts_delete_font() (line 421 of /var/www/fyf/sites/default/modules/fontyourface/modules/local_fonts/local_fonts.module).
Warning: unlink(./CHANGELOG.txt): Permission denied in local_fonts_delete_font() (line 421 of /var/www/fyf/sites/default/modules/fontyourface/modules/local_fonts/local_fonts.module).
(my sandbox fortunately had better configured file permissions :)
This is a problem with Local Fonts module, looking into it.
Wow, that's a pretty huge bug. kervi, thanks for the report and I hope that didn't cause too much trouble for you. Drave Robber, thanks for the quick patch.
Comments
Comment #1
Drave Robber CreditAttribution: Drave Robber commentedWhich submodules were enabled?
I could not quite reproduce this; got a different sort of abnormal behavior though:
(trying to delete a Typekit font; obviously, Local Fonts module should not interfere here)
Comment #2
Drave Robber CreditAttribution: Drave Robber commentedI more or less figured this out. 'Delete font record' belongs to Local Fonts module (and only local fonts are meant to be deleted this way); however, the button is displayed for all fonts, and trying to delete a Google font can lead to files in the root folder being deleted:
(my sandbox fortunately had better configured file permissions :)
This is a problem with Local Fonts module, looking into it.
Comment #3
Drave Robber CreditAttribution: Drave Robber commentedPatch attached.
Display 'Delete font record' button only for local fonts; double-check for font provider in local_fonts_delete_font() function.
Comment #4
sreynen CreditAttribution: sreynen commentedWow, that's a pretty huge bug. kervi, thanks for the report and I hope that didn't cause too much trouble for you. Drave Robber, thanks for the quick patch.
Fix committed.
Comment #5
sreynen CreditAttribution: sreynen commentedOops, missed status change.
Comment #6
dgastudio CreditAttribution: dgastudio commentedDrave Robber, thank you.
sreynen, you are welcome!