field_attach_update stopped working - how to debug this? I am using this simple code:

$order = commerce_order_load($order_id);
$order-&gt;status='completed';
field_attach_update('commerce_order', $order);


To update the status of order to completed.

This code use to work but does not work anymore (the order status is not updated).

How to debug this ?

UPDATE:

Using :

entity_get_controller('commerce_order')-&gt;resetCache(array($order-&gt;order_id));


Does not work neither.
You can't debug what ain't a bug :)

status is a property, not a field, of the commerce_order entity type - so it isn't affected by running field_attach_update(), which just saves field data, and avoids saving the entity itself.

You'll need to use commerce_order_save(), entity_save(), or manipulate the commerce_order table directly, and then clear the cache using the entity controller.