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');
CommentFileSizeAuthor
#5 urlicon_path_01.patch901 bytessanduhrs

Comments

sanduhrs’s picture

This 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.

sanduhrs’s picture

Version: 5.x-1.3 » master
Assigned: the.tdd » sanduhrs
Status: Needs review » Fixed

done.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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

csc4’s picture

Priority: Normal » Critical
Status: Closed (fixed) » Active

I 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:

 $favicon = file_exists(base_path().$dir .'/'. $domain .'.ico') ? (base_path().$dir .'/'. $domain .'.ico') : (base_path().drupal_get_path('module', 'urlicon') .'/favicon.ico'); 

which I think should be

  $favicon = file_exists($dir .'/'. $domain .'.ico') ? (base_path().$dir .'/'. $domain .'.ico') : (base_path().drupal_get_path('module', 'urlicon') .'/favicon.ico');

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)

sanduhrs’s picture

Status: Active » Needs review
StatusFileSize
new901 bytes

It seems you're right.
Please try the attached patch.

csc4’s picture

Thanks for the quick response - can confirm the patch works for me for clean urls and subdirectories

sanduhrs’s picture

Status: Needs review » Fixed

Commited to DRUPAL-5 and HEAD.
Thanks.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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