For a project I am working on, I have to use the LastEdited field, combined with some other data, to infer some information about the DataObject in question. This is fine most of the time, since the LastEdited field is almost always a sane value under normal circumstances.
However, when trying to unit test my code, I run into the problem that despite setting a LastEdited field in my fixture, when the data gets loaded into a temporary database, it sets the LastEdited field to the current time.
My current assumption (somewhat backed up by some initial spelunking into sapphire) is that calling DataObject::write() automatically sets the LastEdited to the current time (expected behaviour).
My question is whether or not there is a way to temporarily disable this functionality, or will I have to patch sapphire to do this?
UPDATE I decided that being able to set the last edited value from the fixture was useful and did the patch. Good news, it’ll be in the next release of silverstripe
I will answer my own question, since it makes life easier.
This is a known bug that will be fixed Silverstripe 3.0.