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've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Data Model Questions /

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

SS2.4 DataObject Versioning error


Go to End


1038 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.