Community Support for OpenDocMan (Deprecated)
UDF value not stored during Add process. - Printable Version

+- Community Support for OpenDocMan (Deprecated) (https://forum.opendocman.com)
+-- Forum: OpenDocMan Community Discussion (https://forum.opendocman.com/forum-5.html)
+--- Forum: OpenDocMan Bug Reports (https://forum.opendocman.com/forum-8.html)
+--- Thread: UDF value not stored during Add process. (/thread-276.html)



UDF value not stored during Add process. - pesky - 06-06-2010

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!


Re: UDF value not stored during Add process. - Stephen - 06-07-2010

Verified. Thanks for the bug report.


Re: UDF value not stored during Add process. - cesout - 11-08-2010

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.