Closed (fixed)
Project:
Upload nodes
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
18 May 2012 at 22:18 UTC
Updated:
11 Jun 2012 at 20:21 UTC
The function upload_nodes_upload_form_submit() does not respect token replacements that may be specified in the file field file directory settings. This may be dealt with in one of two ways. Since both work and are single line changes, and I don't personally have a preference for which method should be used, I haven't created a patch but present both options here.
Code to be changed (line 626 of upload_node.module):
// Check destination
$destination_dir = $field_info['settings']['uri_scheme'] . '://' .
trim($field_info_instance['settings']['file_directory'], '/');
Option 1 (inline use of token_replace()):
// Check destination
$destination_dir = $field_info['settings']['uri_scheme'] . '://' .
token_replace(trim($field_info_instance['settings']['file_directory'], '/'));
Option 2 (use file_field_widget_uri() to do the same as Option 1):
$destination_dir = file_field_widget_uri($field_info, $field_info_instance);
This is a great module, hope to see it released soon!
Comments
Comment #1
pyrollo commentedThanks for that issue !
I've chosen the second solution, looks better. And I added a dependency to file module, because of file_field_widget_uri function and and also because that's logical (need file fields to use Upload Nodes).
Changes commited.