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

Versioned DataObjects not deleted from all Stages when DataObject->delete() is called

Go to End

3 Posts   1513 Views


Community Member, 2 Posts

18 March 2016 at 12:03pm

Perhaps I'm missing something here, but the docs state:

/* Delete this data object.
* $this->onBeforeDelete() gets called.
* Note that in Versioned objects, both Stage and Live will be deleted.
* @uses DataExtension->augmentSQL()
public function delete() {

However, on a versioned DataObject delete() is only removing from the base table and not _Live table.

The delete is being invoked by a GridFieldConfig_RecordEditor.

Are the docs incorrect here, do I need to do an onAfterDelete hook to ensure it's actually deleted from both stage/live tables?


Community Member, 58 Posts

17 March 2017 at 8:19pm

Hi @nzphoenix,

Do you get any solution on that, I am facing the same problem when I tried to delete dataobject from model admin.
Silverstripe version 3.5


Community Member, 2 Posts

20 March 2017 at 1:33pm

Can't fully remember what the solution was here I'm afraid! I think we probably came up with a workaround.