Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Data Model Questions

SS2.4 DataObject Versioning error


Reply

234 Views

Avatar
RyanTrout

8 April 2014 at 3:15pm Community Member, 1 Post

Hi,

Having some trouble with versioning DataObjects in 2.4

I have a Page with a has_many/has_one relationship with a DataObject.

I've applied Versioning to the DataObject using;

static $extensions = array(
   "Versioned('Stage', 'Live')"
);

... run dev/build and it appears to have build all the required tables and so forth.

I can create a new record and save it, but when I edit a record and click 'Save', I get the following error;

[User Error] Versioned::get_version: Couldn't get SiteTree.202, version 1

202 is the ID of the Page the DataObject has a relationship with.

I've run the SQL query in the debug dump, and it's returning 0 rows, which is why I imagine Versioned::get_version is throwing and error.

The DataObject in question already had a few records, and I thought that may have been the cause, but I setup a new DataObject as a test and the same issue occured.

Any help is appreciated.

Thanks.