My drupal site was not in root directory of the server. Icons of this module didn't show.
Changed code on menu_icons.module and now it works ok
Diff from GIT:
@@ -516,11 +516,11 @@ function menu_icons_css_generate() {
if ($absolute) {
$image_url = file_create_url($image_path);
}
else {
$wrapper = file_stream_wrapper_get_instance_by_scheme(file_uri_scheme($image_path));
- $image_url = '/' . $wrapper->getDirectoryPath() . '/' . file_uri_target($image_path);
+ $image_url = $GLOBALS['base_path'] . $wrapper->getDirectoryPath() . '/' . file_uri_target($image_path);
}
$size = $pos == 'right' || $pos == 'left' ? $info['width'] : $info['height'];
// Support private filesystem
$css .= theme('menu_icons_css_item', array('mlid' => $item->mlid, 'path' => $image_url, 'size' => $size, 'height' => $info['height'], 'pos' => $pos, 'source' => $source_uri));
Comments
Comment #1
volker23 commentedThanks , this worked for me....
Comment #2
dave reidPatch attached for 7.x-3.x.
Comment #3
rooby commentedThis fixes the problem.
Comment #3.0
rooby commentedSpelling
Comment #4
nerdoc commentedI can confirm that Dave Reids patch in comment #2 fixes the issue.
Comment #5
rcodinaPath in comment #2 also works for me. Thanks!
Comment #6
RIMAD commented#2 works for me too. Thanx a lot!
Comment #7
Leonid92 commentedSorry my bad English. I in file menu_icons_css_item.tpl Replace
background-image: url(<?php print $path ?>);onbackground-image: url(../<?php print $path ?>);.In File menu_icons.module string 520 Delete and string 521 replace
$image_url = '/' . $wrapper->getDirectoryPath() . '/' . file_uri_target($image_path);on$image_url = '/' . file_uri_target($image_path);Comment #8
Anonymous (not verified) commentedHi Leonid92,
Your changes worked for me!!! At last!
I have drupal running on a subdirectory of my website and the path to the images was always wrong until I tried what you suggested.
Comment #9
7drupel7 commentedI think many of us appreciate the patch in comment #2. Can someone commit that one ?
Comment #10
luisasasi commentedPath in comment #2 also works for me. Thanks!