Edited.

Drush CC (Clear Cache) will process the CSS template and overwrite the current menu_icons.css, but it does not create the background image $path correctly. It uses "Default" where "Domain.com" should be. Using the URI option with drush will process the path correctly. "drush cc all -l http://domain.com"

Comments

whthat’s picture

Title: Add menu_icons_css_item.tpl.php overide in theme » Drush CC (Clear Cache) will process the CSS template with incorrect background image $path

Title Update - Narrowed the scope of the issue.

kevinquillen’s picture

Confirmed.

Is there any particular reason why the CSS generates a full URL to the image instead of a relative path?

iterator’s picture

Finally it´s a drush issue http://drupal.org/node/743368

Anyway, maybe a relative path would be better.

kevinquillen’s picture

Looks like that was closed/fixed? 2 years ago?

emilorol’s picture

Hi,

I had a similar issue, please check http://drupal.org/node/1516326#comment-5919470 for a solution that work in my case.

Thank you,
Emil

steve.hartley’s picture

Anybody looking for a quick solution for this just add to your settings.php file the base_url for your site i.e
$base_url = 'http://local.example.com';

kevinquillen’s picture

Doesn't that have unintended side effects on existing websites?

iterator’s picture

The fix was adding a note to README.txt :)

The problem is:

if -l is not specified, then Drush has nowhere to get the correct base url, because the web server gets this from the http request, which drush is simulating

If you clear the cache within your performance settings on your website everything will be fine.

You can use the "l" option with drush to avoid this issue:
drush cc all -l http://example.com

//edit
In my opinion it would be better to use a relative path. In the function menu_icons_css_generate() the code for generating the $image_url currently is:
$image_url = file_create_url($image_path);
This could be change to anything similar like:
$image_url = '/' . file_stream_wrapper_get_instance_by_uri($image_path)->getDirectoryPath() . '/' . file_uri_target($image_path);
I don´t know if there is a shorter way to do that.

acrollet’s picture

Status: Active » Closed (duplicate)

Closing as a duplicate of #743368: $GLOBAL['base_url'] set to http://default - I've also added information to the README, see http://drupalcode.org/project/menu_icons.git/commit/ec20517

acrollet’s picture

Issue summary: View changes

Modified Issue Description