Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
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));
Comment | File | Size | Author |
---|---|---|---|
#2 | 1960802-relative-base-path.patch | 607 bytes | Dave Reid |
Comments
Comment #1
Volker23 CreditAttribution: Volker23 commentedThanks , this worked for me....
Comment #2
Dave ReidPatch attached for 7.x-3.x.
Comment #3
rooby CreditAttribution: rooby commentedThis fixes the problem.
Comment #3.0
rooby CreditAttribution: rooby commentedSpelling
Comment #4
nerdoc CreditAttribution: nerdoc commentedI can confirm that Dave Reids patch in comment #2 fixes the issue.
Comment #5
rcodina CreditAttribution: rcodina commentedPath in comment #2 also works for me. Thanks!
Comment #6
RIMAD CreditAttribution: RIMAD commented#2 works for me too. Thanx a lot!
Comment #7
Leonid92 CreditAttribution: 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) CreditAttribution: Anonymous 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 CreditAttribution: 7drupel7 commentedI think many of us appreciate the patch in comment #2. Can someone commit that one ?
Comment #10
luisasasi CreditAttribution: luisasasi commentedPath in comment #2 also works for me. Thanks!