04-23-2010, 02:04 AM
Not a bug as such, but I found a limitation that meant I had problems with User Defined Fields.
I updated 1.2.5.6 -> 1.2.5.7, as described in another thread, but still had problems making UDF work properly. After successfully creating a UDF field, I clicked on the link to add a new value and there were several php warnings:
Warning: mysql_fetch_row() expects parameter 1 to be resource, boolean given in E:\xampp\htdocs\docs\udf.php on line 356
Warning: mysql_free_result() expects parameter 1 to be resource, boolean given in E:\xampp\htdocs\docs\udf.php on line 358
Warning: mysql_fetch_row() expects parameter 1 to be resource, boolean given in E:\xampp\htdocs\docs\udf.php on line 377
Warning: mysql_free_result() expects parameter 1 to be resource, boolean given in E:\xampp\htdocs\docs\udf.php on line 384
Anyway, after a bit of investigation I discovered the problem. I had set up a UDF called 'partner'. The actual table set up by ODM was called 'odm_udftbl_partner', but the reference to this table stored in odm_udf.table_name was 'odm_udftbl_partn'. The name had been truncated as the field is limited to 16 characters. I changed the type to varchar(25), corrected the data and the problem went away.
I'd suggest increasing the 16-character limit in odm_udf.table_name, since 11 characters are immediately used up by the 'odm_udftbl_' prefix. Alternatively make sure it's clear that the user-defined table name is limited to 5 characters.
Cheers,
Mike
I updated 1.2.5.6 -> 1.2.5.7, as described in another thread, but still had problems making UDF work properly. After successfully creating a UDF field, I clicked on the link to add a new value and there were several php warnings:
Warning: mysql_fetch_row() expects parameter 1 to be resource, boolean given in E:\xampp\htdocs\docs\udf.php on line 356
Warning: mysql_free_result() expects parameter 1 to be resource, boolean given in E:\xampp\htdocs\docs\udf.php on line 358
Warning: mysql_fetch_row() expects parameter 1 to be resource, boolean given in E:\xampp\htdocs\docs\udf.php on line 377
Warning: mysql_free_result() expects parameter 1 to be resource, boolean given in E:\xampp\htdocs\docs\udf.php on line 384
Anyway, after a bit of investigation I discovered the problem. I had set up a UDF called 'partner'. The actual table set up by ODM was called 'odm_udftbl_partner', but the reference to this table stored in odm_udf.table_name was 'odm_udftbl_partn'. The name had been truncated as the field is limited to 16 characters. I changed the type to varchar(25), corrected the data and the problem went away.
I'd suggest increasing the 16-character limit in odm_udf.table_name, since 11 characters are immediately used up by the 'odm_udftbl_' prefix. Alternatively make sure it's clear that the user-defined table name is limited to 5 characters.
Cheers,
Mike