Skip Navigation

Small but important change to update_entity & reason_update_entity

June 26, 2012 at 10:31 am
By Matt Ryan

We just made a small change to update_entity() (and by extension, reason_update_entity()). You can now pass a last_modified value in the update array, and the last_modified date of the entity will be set to that value. Previously update_entity ignored any last_modified value passed, always setting it to mysql NOW().

This change was made to accommodate a need for a way to update archived entities without changing their last_modified dates -- now one can do this by just including the item's last_modified date in the updates array.

This change will not effect most code, but there is a specific case where things will change -- if your code was taking advantage of the fact that update_entity was ignoring last_modified, and passing a full array of current entity values to the function. Any code that does this will now, in effect, NOT be updating the last_modified time. This could be confusing, particularly in the history/archive module.

As always, best practice for using reason_update_entity() and update_entity() is to pass just those values that have changed. If you have been following this practice, your code should continue to work without modification.

 

Add a comment

Name*
Comment*
The following fields are not to be filled out. Skip to Submit Button.
Not Comment
(This is here to trap robots. Don't put any text here.)
not URL
(This is here to trap robots. Don't put any text here.)
Avoid
(This is here to trap robots. Don't put any text here.)
  

Posted In