Closed (fixed)
Project:
Bibliography Module
Version:
5.x-1.16
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
24 Mar 2009 at 22:14 UTC
Updated:
18 Aug 2009 at 19:20 UTC
When clean URLs are enabled on filtering, e.g. /biblio/author/Smith or /biblio/year/2009, download links for papers become incorrect, pointing to /biblio/author/Smith/files/file.pdf instead of /files/file.pdf. The following patch fixes the problem:
Index: biblio.module
===================================================================
--- biblio.module (revision 226)
+++ biblio.module (working copy)
@@ -2051,7 +2051,7 @@
$output .= ' '. t('Download') .': ';
$output .= '<span class="biblio_export_links">';
foreach ($node->files as $file) {
- $output .= ' <a href="' . $file->filepath . '">' . $file->filename . '</a> ';
+ $output .= ' <a href="' . file_create_url($file->filepath) . '">' . $file->filename . '</a> ';
}
$output .= '</span>';
}
Please review.
| Comment | File | Size | Author |
|---|---|---|---|
| fix-biblio-download.patch | 596 bytes | Alexander Ufimtsev |
Comments
Comment #1
rjerome commentedThanks for pointing that out, I'm surprised no one ran into this before.
I did something a little different than you suggested, I used the l() function instead like this...
Ron.
Comment #2
Alexander Ufimtsev commentedYes, l() seems to be more elegant, though both of l() and file_create_url() end up calling url() at the end of the day anyway. I'm also surprised that out of almost 300 installations we were the first to spot this bug.
Thank you, Ron!
Alexander
Comment #3
rjerome commentedFYI, I'm going to roll a new 5.x release later this week which will contain this fix as well as a few enhancements (some new styles: AMA, Chicago, MLA and Vancouver)
Ron.
Comment #4
rjerome commentedComment #6
Alexander Ufimtsev commentedHi Ron,
Any chance of a release any time soon?
A
Comment #7
rjerome commentedOops, this one completely slipped my mind (and since it was automatically closed) it slipped off the radar screen, sorry about that.
Comment #8
rjerome commentedThe new release is out now.
Ron.
Comment #9
Alexander Ufimtsev commentedcheers! works perfectly!