Hi,

Great module! For sites that are installed at http://www.example.com/subdirectory this module does not work because you forgot to include base_path() when creating the image tag.

Correct code is below - starting on line 165 of barcode.module

     if (!empty($element['#item']['title'])){
        return '<img src="'.base_path().$filename.'"> -- '.$element['#item']['title'];
     }else return '<img src="'.base_path().$filename.'">';
  }else return '';

Comments

skyredwang’s picture

thanks for the fix.

arhak’s picture

Status: Active » Needs review

barcode.module, lines 166 & 167
<img src="/' . $filename . '"> should be created using Drupal's function url(), so image path doesn't brake when Drupal is installed in a subdirectory

seanhe’s picture

I have made the suggested changes to the module code, but I am still having an issue with the Barcode showing up. I am using a site installed within a subdirectory. Is there a patched version coming out soon?

shadowx’s picture

I think it should work if you modify 165-167 line on barcode.module to this:

     if (!empty($element['#item']['title'])){
        return '<img src="'. url($filename) .'"> -- '.$element['#item']['title'];
     }else return '<img src="'. url($filename) .'">';
slip’s picture

Status: Needs review » Closed (fixed)

Should be good in 2.0-dev branch. Thanks everybody.