Needs work
Project:
Flexinode
Version:
4.6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
12 Oct 2005 at 19:03 UTC
Updated:
25 Dec 2006 at 12:30 UTC
There is support for two files with the same name: _0, _1, etc. is added before the extension. This is done at upload. The correct link is displayed, but when in flexinode_file_download the database is queried, it looks at the serialized_data field for the filename, and that one hasn't _X in the name, so the entry is not found. A workaround follows. Change line 729 of flexinode.module (v1.46.2.2)
$result = db_fetch_object(db_query("SELECT f.* FROM {flexinode_data} f WHERE f.textual_data = '%s'", $file))
to look at the serialized_data instead, where the real filename is encoded:
$result = db_fetch_object(db_query("SELECT f.* FROM {flexinode_data} f WHERE f.serialized_data LIKE '%%\/%s\";%%'", $file));
This is not a foolproof method, but provides a workaround in most cases.
Comments
Comment #1
wvengen commentedOops, I meant of course that flexinode_file_download currently looks at the textual_data_field and not at serialized_data.
Comment #2
espry commentedBrilliant! This works great for me, solved a very annoying proble. Files were uploaded, but not accessible through the web. I assume this might have been fixed in later versions of flexinode? Maybe the status of this bug should be updated?
Comment #3
Bèr Kessels commentedplease provide a proper patch. also note that file fields are NOT released, the main reason is that they don't work well! Which means: Don't use them!