Community Support for OpenDocMan (Deprecated)

Full Version: UDF value not stored during Add process.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi there,

Just simulated this on the live demo page. Basically added one UDF and about 3 values to it. Then tried to add a new file and select a value in the new UDF (keyed in other required information during the add process as well). However after clicking Add Document and viewing the file's properties, the selected value of the UDF is not stored (ie. its a blank). Only way to store the value of the UDF is to edit the file's properties and selecting the UDF value again.

Would be nice if UDF values were captured during the Add process. Thanks for your support!
Verified. Thanks for the bug report.
I think I have found the problem. Look in udf_functions.php and find the function called udf_add_file_insert($fileId). In the UPDATE query string change the the SET column reference quote marks to the 'slash' looking quote marks. It is the one that is on the tilde key, below the tilde.

Like this:

Before:
$query = "UPDATE {$GLOBALS['CONFIG']['db_prefix']}data SET '{$row['0']}' = '{$_REQUEST[$row['0']]}' WHERE id = '$fileId'";

After:
$query = "UPDATE {$GLOBALS['CONFIG']['db_prefix']}data SET `{$row['0']}` = '{$_REQUEST[$row['0']]}' WHERE id = '$fileId'";

Cheers.