Closed (fixed)
Project:
Taxonomy Image
Version:
6.x-1.5
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
16 Feb 2009 at 09:42 UTC
Updated:
3 Mar 2009 at 19:00 UTC
Jump to comment: Most recent file
in taxonomy_image.admin.inc, the wrong path is saved into the database, and this causes problems once the files directory changes place.
Line 26 states:
<?php
$files_path = variable_get('file_directory_path', 'files') .'/';
?>
While it should simply be:
<?php
$files_path = file_directory_path();
?>
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | taxonomy_image_correct_path.patch | 1.23 KB | z.stolar |
Comments
Comment #1
z.stolar commentedActually the problem is deeper.
The path to be saved in the DB is the relative path under 'files'. Then, during display, the full path should be reconstructed. A patch is currently under work.
Comment #2
z.stolar commentedAttached is a patch that should fix it for future uploads. It doesn't, however, fixes existing image paths in DB.
Comment #3
z.stolar commentedComment #4
nancydruWow, it must be time for a new release; your patch wasn't even close to the -dev code I have.Comment #5
nancydruI backed this out. My testing was messed up by the cache. With your change, every site would be broken. A hook_update_N is mandatory for this. I'm thinking of a different way to go.
The "term_image" table stores the same value that is in the "files" table, which is the full path name, including the "file_directory_path()". These need to match currently. I see this as de-normalizing the db.
Comment #6
z.stolar commentedIndeed, cache should be cleared, and DB entries should be changed. I'll try to add it.
Comment #7
nancydruI am still debating which is the right approach. FYI, there is a slight wrinkle in this that comes from #305656: Link to external image.
Comment #8
nancydruI have the hook_update functioning; I just need a bit more testing.
Comment #9
nancydruCommitted to 6.x only.