nid query in filerequest.module does not work with "private" files
iva2k - October 22, 2006 - 20:37
| Project: | FileRequest |
| Version: | 4.7.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Description
line 108 in filerequest.module:
$result = db_result(db_query("SELECT nid FROM {files} WHERE filepath = '%s'", $config["filename"]));
will not return nid for any file uploaded under private files.
`filepath` field in the {files} table stores absolute paths when file uploads are private and files directory is specified by absolute path.
Other modules (such as image.module) still store relative paths in this field.
Rework is to run 2 queries, one with file's absolute path, and another with relative path as it is done now.
