Closed (fixed)
Project:
URL Icon
Version:
master
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Reporter:
Created:
9 Jan 2008 at 11:39 UTC
Updated:
3 Mar 2008 at 17:12 UTC
Jump to comment: Most recent file
url icon doesn't work on other pages but front page if clean urls (by example, node/11) are used!
The icons are referring on non-existing directory in node/files/.../....ico instead of files/.../....ico.
I solved that with this patch (urlicon.module):
Instead of
// check for favicon availability
$favicon = file_exists($dir .'/'. $domain .'.ico') ? ($dir .'/'. $domain .'.ico') : (drupal_get_path('module', 'urlicon') .'/favicon.ico');
I'm using this code and it seems to works fine.
// check for favicon availability
$favicon = file_exists($dir .'/'. $domain .'.ico') ?
dirname($_SERVER['PHP_SELF']).'/'.$dir .'/'. $domain .'.ico'
:
dirname($_SERVER['PHP_SELF']).'/'.(drupal_get_path('module', 'urlicon') .'/favicon.ico');
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | urlicon_path_01.patch | 901 bytes | sanduhrs |
Comments
Comment #1
sanduhrsThis behaviour seems to occur, when Drupal is installed in a subdirectory.
Changed line 144 from
$favicon = file_exists($dir .'/'. $domain .'.ico') ? ($dir .'/'. $domain .'.ico') : (drupal_get_path('module', 'urlicon') .'/favicon.ico');to
$favicon = file_exists(base_path().$dir .'/'. $domain .'.ico') ? (base_path().$dir .'/'. $domain .'.ico') : (base_path().drupal_get_path('module', 'urlicon') .'/favicon.ico');and commited to HEAD and DRUPAL-5.
Thanks.
Comment #2
sanduhrsdone.
Comment #3
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #4
csc4 commentedI think this patch is not quite right.
I've not used earlier versions so did a download and install - and I use subdirectories.
The problem is the module appeared not to work - I only ever saw the default favicon.ico (though the icon's were being correctly downloaded)
I've traced it to:
which I think should be
i.e. adding the basepath to the dir - base_path().$dir - stops the file exists test working.
I've marked it as critical as with the code as it currently stands I'm not sure it's working for anyone using the downloaded version?
I'm also finding the themeing appears to remove the space to the work after the link? (though that's obviously a minor point)
Comment #5
sanduhrsIt seems you're right.
Please try the attached patch.
Comment #6
csc4 commentedThanks for the quick response - can confirm the patch works for me for clean urls and subdirectories
Comment #7
sanduhrsCommited to DRUPAL-5 and HEAD.
Thanks.
Comment #8
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.