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.

We're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

Data Model Questions /

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

SS2.4 DataObject Versioning error


Go to End


703 Views

Avatar
RyanTrout

Community Member, 1 Post

8 April 2014 at 3:15pm

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.