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();
?>
CommentFileSizeAuthor
#2 taxonomy_image_correct_path.patch1.23 KBz.stolar
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

z.stolar’s picture

Assigned: Unassigned » z.stolar

Actually 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.

z.stolar’s picture

Attached is a patch that should fix it for future uploads. It doesn't, however, fixes existing image paths in DB.

z.stolar’s picture

Status: Active » Needs review
NancyDru’s picture

Wow, it must be time for a new release; your patch wasn't even close to the -dev code I have.

NancyDru’s picture

Status: Needs review » Needs work

I 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.

z.stolar’s picture

Indeed, cache should be cleared, and DB entries should be changed. I'll try to add it.

NancyDru’s picture

I am still debating which is the right approach. FYI, there is a slight wrinkle in this that comes from #305656: Link to external image.

NancyDru’s picture

Status: Needs work » Active

I have the hook_update functioning; I just need a bit more testing.

NancyDru’s picture

Status: Active » Fixed

Committed to 6.x only.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.