It's currently impossible to upload a favicon with the extension .ico (which is the only format supported in all relevant browsers: http://en.wikipedia.org/wiki/Favicon#Browser_support), because ico is not an allowed extension.

This patch checks for the extensions ico png jpg jpeg (the formats supported in all major browsers, some not in IE<8)
Also fixes the wrong field being marked when the upload fails.

Comments

joachim’s picture

Status: Needs review » Needs work

Looks okay to the eye, but why are you changing the form element the error is set on?

- form_set_error('logo_upload', t('The favicon could not be uploaded.'));
+ form_set_error('favicon_upload', t('The favicon could not be uploaded.'));

If that is a separate bug, then it's a separate bug ;)

Stevel’s picture

Status: Needs work » Needs review

I added it in the same patch, because it also occurs when uploading the .ico file fails. Plus both changes are in the same function.

joachim’s picture

Status: Needs review » Needs work

That does still need a separate issue though, sorry. One issue per problem.

antgiant’s picture

Status: Needs work » Needs review
Issue tags: +Usability, +D7UX
StatusFileSize
new747 bytes

Updated patch to get this issue resolved.

Bojhan’s picture

Category: bug » feature

I see no reason why we should support this by default, it is not a commonly used format - by this same argumenting we should also support .icns

antgiant’s picture

Category: feature » bug

This is referring to favicons not logos. Prior to IE 8 there is no other file format supported by all browsers, as was noted in the original bug report (http://en.wikipedia.org/wiki/Favicon#Browser_support).

ico is by far the most common format for favicons. Nearly 30% of people browsing the web can only see favicons in ico format. (See here http://en.wikipedia.org/wiki/Template:Msieshare1)

Bojhan’s picture

Category: bug » feature

Sorry, but I see no reason for that to be a supportive argument. Sure, it was supported by all but used by almost none? Why would it be a common use case to upload favicons? After all you don't do that through the interface.

Adding a exstention, is not a bug - it works perfectly, you can add it yourself. Even adding something like JPG would be a feature request.

eigentor’s picture

Question is: does someone who can handle creating an .ico file find the setting to add the .ico extension to the allowed formats.

If not, I'd be supportive of allowing the .ico Format, as it is indeed the default format for Favicons and there are are applications out there that do nothing but create Favicons. I don't see a way allowing another file format is bound to introduce a lot of followup issues.

antgiant’s picture

Category: feature » bug
StatusFileSize
new760 bytes
new16.71 KB

I'll try again. This is referring to the "Upload icon image" functionality that is part of core Drupal (See attached screenshot).

The upload process already supports " jpg jpeg gif png txt doc xls pdf ppt pps odt ods odp" this is simply trying to get ico added to that list. For what it is worth only the first 4 of those formats are even supported favicon formats. The other formats won't work no matter what your browser. To be fully correct that list should be "ico png gif jpg jpeg apng svg" (The attached patch implements this list.)

The ico file format is the most popular format and is used by most major websites. (Drupal.org, google.com, facebook.com, wikipedia.com, etc. Here is a map of the internet made this year from the favicons of the top 1,000,000 websites.)

If you don't feel the "Upload icon image" feature should be in Drupal core please create an issue to have it removed. This issue is just trying to get the existing feature to work correctly for the vast majority of users.

Bojhan’s picture

Status: Needs review » Reviewed & tested by the community

I never knew we had such a feature, thats soo weird. Now you are making sense, I thought you where arguing this for image field in article page - unless I am totally missing it, you are never mentioning its for "this".

Fixes a bug, so yes.

dries’s picture

Status: Reviewed & tested by the community » Needs work

Looks like we're using a tab instead of a space. This will need a quick re-roll but is otherwise RTBC.

Stevel’s picture

Status: Needs work » Needs review
StatusFileSize
new760 bytes

Changed the tab to a space as per Dries' comment

Bojhan’s picture

Status: Needs review » Reviewed & tested by the community
dries’s picture

Status: Reviewed & tested by the community » Fixed

Committed to CVS HEAD. Thanks.

Status: Fixed » Closed (fixed)
Issue tags: -Usability, -D7UX

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