When installed into subdirectory images do not display

Bug #350536 reported by Carl
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ideatorrent
New
Undecided
Unassigned
Nominated for 0.9 by pecus
Nominated for Trunk by pecus

Bug Description

If your installed drupal is in a subdirectory
ex:
http://localhost/drupal/etc

Images do not display.

Example incorrect Image tag obtained from 'view->source': (missing drupal directory in path)

<img src="/modules/ideatorrent/themes/brownie/images/frontpage-thunder.png" alt="Popular ideas">

Revision history for this message
Andrew Harvey (andrew-harvey4) wrote :

i can confirm this.

Revision history for this message
Ryan Lane (rlane32) wrote :

Around 32 images aren't added properly. This first patch is for qapoll.css.

Revision history for this message
Ryan Lane (rlane32) wrote :

This second patch is for: modules/ideatorrent/themes/brownie/common/navigationtopbar.php

Revision history for this message
Ryan Lane (rlane32) wrote :

Gah. Ignore these patches, they don't really fix the issue. To truly fix the issue, the images need to be from the base directory, and not from /

I'll resubmit patches when I fix it properly.

Revision history for this message
Ryan Lane (rlane32) wrote :

This is broken all over the theme, it it would be painful to make a patch. You can fix this with the following command run from modules/ideatorrent/themes/brownie:

find . -type f | xargs sed -i 's#echo "/" . $this->getThemePath();#echo "" . base_path() . $this->getThemePath();#'

Essentially, this tells the module to use drupal's base path instead of using "/".

The CSS file also needs to be fixed:

sed -i 's#url(.*images/#url(../images/#' css/qapoll.css

This makes the CSS find the images directory one directory below the CSS.

Revision history for this message
Ryan Lane (rlane32) wrote :

Another fix. qawebsite.display.php has a link to change a user's password that links to /user/<number>/edit, and should instead link to /base_path()/user/<number>/edit.

I've attached a patch for it.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.