I've been learning Drupal 7 this week by creating a website at localhost on a WAMP server. Everything was going fantastic until I installed the @font-your-face module, enabled Font Squirrel, enabled a few fonts, then tried to delete one of them in the Admin area. When I clicked on "Delete Local Font" my website instantly disappeared, replaced at localhost/drupal with a page with the title "Index of /drupal", showing the sites folders. No error messages at all. I also have the website set up on Dreamweaver and everything appears to still be there. I can't find anyone else with an issue like this. I found an htaccess file at c/wamp/www/drupal/sites/default, all it says is this:
SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006
Options None
Options +FollowSymLinks

In a drupal temp file there's an htaccess file that says this:
SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006
Deny from all
Options None
Options +FollowSymLinks

Can I copy and paste new htaccess content and get the website working again? Or does something else need to be fixed?

I'm hoping there's some simple fix for this. I don't have the database backed up, hadn't learned how to do that yet, but I do have Drush installed and I've used it some.

Thanks for any help with this.

Comments

Drave Robber’s picture

Component: Font Squirrel (provider) » Miscellaneous
Assigned: zenific » Unassigned
Category: bug » support

This bug was reported a while ago in #1786386: Local Fonts module allows 'deleting' non-local fonts, with potentially disastrous results and is already fixed in -dev.

The essence of the problem: only local fonts were ever meant to be deleted, one should never try to 'delete' fonts from Font Squirrel, fonts.com, etc.

It seems that files in your Drupal root folder (index.php, cron.php, install.php etc. - there are 19 files in a root folder of a fresh Drupal 7 installation) have been deleted; as these files are normally never changed (except .htaccess), you can restore them from another Drupal installation or a fresh download.

zenific’s picture

Thanks so much for pointing me in the right direction and what to do. All those files had been deleted like you said but copying in new ones restored the website, except I had a long list of error messages, all regarding font-your-face. There was a warning for each of the folders at the root level, here's just one of them:

Warning: unlink(./includes): Permission denied in local_fonts_delete_font() (line 421 of C:\wamp\www\drupal\sites\all\modules\fontyourface\modules\local_fonts\local_fonts.module).

After disabling that module and it's child modules all seems to be back to the way it was before I installed it and the error messages are no longer displayed.

When the site disappeared I was just trying to remove a font I decided I didn't want from the local list of fonts I had just enabled, not remove any fonts from Font Squirrel itself. That shouldn't even be possible to do. It seems like if a version of a module has a known critical error it should be removed from the Recommended Release list until a fix is made. I've only been using drupal for a few days so I don't know if this is a common occurrence or not.

Thanks again for your help.

sreynen’s picture

It seems like if a version of a module has a known critical error it should be removed from the Recommended Release list until a fix is made.

You're absolutely right. That was my mistake in waiting on making a new release, not expecting anyone else to be bit by this bug in the mean time. Apologies that it bit you. I'll make a new release now, and if you need any help repairing your site, let me know.

zenific’s picture

My site seems to be working fine now and I have Backup & Migrate set to do automatic backups. Any idea when your new release will be ready? Thanks so much!

sreynen’s picture

Status: Active » Fixed

The new 7.x-2.5 release is up now. I think this is fixed now. Please move it back to active if I've missed something.

BarisW’s picture

@zenific: you might want to check your file permissions as well. The module should not even be able to delete files in the root of you site, only in the files directory.

zenific’s picture

Status: Fixed » Active

I updated the parent and child modules. When I enabled them all it couldn't find the Google font module with the url it searches with. It couldn't in the previous version either. So I disabled the Google font module. When I went to the Appearance section to enable fonts the only module without an error or that had fonts was Font Squirrel. I think this was the case last time too. Fontkit and Typedeck were displaying errors. So I disabled them. So that left Font Squirrel, Fonts.com and Local Fonts active. On the Browse all Fonts page if I select the Fonts.com tab it has the message "There was an error importing a font list from Fonts.com". Local fonts has an error message too, and clicking on the import link just opens the @font-your-face settings page where Local fonts is listed as having 0 fonts. The only one with fonts is Font Squirrel, with 612 fonts. So far the results are no different. At least Font Squirrel seems to work. But if I click on the Update Font Squirrel fonts button it says "There was an error importing fonts from Font Squirrel", but it still lists 612 fonts being available. I didn't try that button last time but I'm guessing it probably would have been the same.

So I have these modules currently enabled, all version 2.5: @font-your-face, @font-your-face UI, Font Squirrel API, Fonts.com, Local Fonts and WYSIWYG for @font-your-face.

But now, there's a new error. On the Font Squirrel tab on the Browse All Fonts page I can only view the first page of fonts now. Clicking on any of the page numbers, Next, or Final links at the bottom of the page results in that first page just scrolling back to the top of the page. In the previous version the links worked fine. So I didn't try to enable any fonts. I'll wait until you get that fixed. Thanks.

Drave Robber’s picture

Could you please copy/paste exact error messages? Otherwise, we can get confused as to which one of similar errors you got.

But if I click on the Update Font Squirrel fonts button it says "There was an error importing fonts from Font Squirrel"

It could say There was an error downloading font list from Font Squirrel.; this only happens if drupal_http_request('http://www.fontsquirrel.com/api/fontlist/all') results in return code other than 200. As there are similar problem with other submodules, it seems your server's ability to make outgoing HTTP requests is impaired, either by that debacle earlier or by something external. Are you able to check for available updates to modules (Reports - Available updates - Check manually)? (this is the easiest way to check whether the server is able to make HTTP requests)

sreynen’s picture

Title: website replaced by Index of Drupal page after clicking "Delete Local Font" button » Errors on updating to 7.x-2.5
Version: 7.x-2.4 » 7.x-2.5

Try disabling the WYSIWYG module. As mentioned in the release notes, that's not completely done yet, and you're having enough other problems that it's probably not worth testing.

In the future, please open separate issues for new problems. Other people might be having the same problems and mixing multiple problems together in the same issue makes them more difficult for others to find.

zenific’s picture

I wasn't sure if it should be considered a new issue or not. Now I know. I can start a new issue if you like but I'd like to respond to your replies here.

Checking for updates manually works fine. Everything works fine on my site including all the other modules I've installed. This is the only module I've had problems with so far.

Disabling WYSIWYG makes no difference with the links, but I'm not getting any error messages anymore. I only have @font-your-face, @font-your-face UI, and Font Squirrel API enabled now. I've just discovered something else though. Hovering over a page link I get the URL displayed at the bottom of the screen. If I type that URL in I can get to the page. I just typed this and it opened the last page of fonts:

http://localhost/drupal/?q=admin/appearance/fontyourface/browse/fontsqui...

Before all I was seeing for a url was this, which didn't change when I clicked on a page link:
http://localhost/drupal/?q=admin/appearance/fontyourface/browse/fontsqui...

So it's just something with those links that is broken. And now all I have to do is change the page number from 12 to view each page. I'll try enabling some fonts tomorrow. I'm in Thailand and it's getting late.

Thanks all for your help.

sreynen’s picture

zenific, what browser are you using? Sounds like this might be a browser-specific problem.

zenific’s picture

I'm using Chrome Version 22.0.1229.79 on Windows 7. I hope people aren't having issues with Chrome. It's my favorite browser.

I just got this error in a popup box clicking on the Next link on Font Squirrel page 1. This is the first time it's happened:

The page at localhost says:

An AJAX HTTP error occurred.
HTTP Result Code: 200
Debugging information follows.
Path: /drupal/?q-views/ajax&render=overlay
StatusText: OK
Response Text:

This is the Font Squirrel page url if it helps any:
http://localhost/drupal/#overlay=%3Fq%3Dadmin/appearance/fontyourface/br...

UPDATE:
I found a similar issue at node/1721276. Enabling clean URLs, then clearing the cache fixed that for them, but not for me. At least I figured out how to enable clean URLs by turning on the rewrite_module in httpd.conf. I haven't had the Ajax error message anymore, just a clock icon when I click on any link at the bottom of the page. Since the bottom links don't work for me another way I can navigate the pages is to select from the font type tags drop down list. It will display those fonts, but only the first page if there is more than one. Really weird that those links aren't working if they are for everyone else using them.

sreynen’s picture

Status: Active » Closed (cannot reproduce)

I think this has become irrelevant, since we're now 2 versions past 2.5.