RepTags looks for a file at /modules/reptag/tags/sample.png each time it loads. However, the path to that file is specified as relative in the code, so pages created with an alias (i.e. www.example.com/foo/mypage) try to load the file from the wrong location (in this example, www.example.com/foo/modules/reptag/tags/sample.png instead of www.example.com/modules/reptag/tags/sample.png).

This seems especially strange since the sample image included with RepTags is supposed to reside at modules/reptag/images/sample.png!

The BBCode and Image submodules reference the image they use for samples like this: ". $basepath_images ."/sample.png

However, the STF submodule references its sample image in modules/reptag/tags/stf.tags.inc like this, which is probably the problem:

    '[image text]@{path/to/sample.png}'                                    =>  '<img src="'. drupal_get_path('module', 'reptag') .'/tags/sample.png" alt="image text" />',
    '@{path/to/sample.png}'                                                =>  '<img src="'. drupal_get_path('module', 'reptag') .'/tags/sample.png" alt="" />',

The problem is the way the result from drupal_get_path is sourced; the syntax '. drupal_get_path($type, $name) .' returns the relative path because drupal_get_path uses the dirname PHP function. I understand the reasoning behind using relative paths, since it allows the reptag directory (and drupal itself) to be symlinked. I don't understand, however, why the $basepath_images variable wasn't used instead. Even if drupal_get_path() is kept, the directory instruction which follows should be changed to /images/sample.png instead of /tags/sample.png.

Comments

icecreamyou’s picture

Status: Active » Closed (duplicate)

This somehow got submitted three times. :(