7.5.1 AOS_Products Database failure on updating record

Version 7.5.1

I can add records to the aos_products module, but if I try to update a record I get a database error. If I look in the log the id="{{UUID}}" part is missing form the query.


 SET `name`='A Product',`date_modified`='2016-02-25 13:00:40',`modified_user_id`='738c94d1-b46d-353f-72ca-4f8bf864afc4',`created_by`='17ceb719-7a1e-bd2f-052b-4e8496848fa5',`description`=NULL,`assigned_user_id`='17ceb719-7a1e-bd2f-052b-4e8496848fa5',`maincode`='XXXX',`part_number`=NULL,`category`=NULL,`type`='Good',`cost`=0,`cost_usdollar`=0,`currency_id`='',`price`=120,`price_usdollar`=120,`url`=NULL,`contact_id`='',`product_image`=NULL,`aos_product_category_id`='ebf5e505-babf-d3b1-f392-56a2120e6fa3'
WHERE  AND deleted=0

I’ve tried the usual repair/rebuild options but to no avail. Can anyone shed some light on this problem?

Thanks john

Hi,

Solved this eventually, so for the interested please avoid repeating the following development error:

I was extending the AOS_Products bean and using a Trait on the extended class. The Trait had a method named getFieldValue(), which I’m now aware, is also a method in the SugarBean class (which obviously AOS_Products extends). To prevent this mistake, I’ll now append trait method names with something thats makes them unique.

I could also use the conflict resolution method described in the php Traits page, but this is more for conflicts between multiple Traits and I’m not actually sure it would help with overriding class methods.

Thanks to anyone who read this far!

John