WPP-Public/akqa-nz-silverstripe-versioneddataobjects

Help to add to existing site

Closed this issue · 1 comments

At the moment adding this to an existing site leaves all data-objects as unpublished. Do you have a way of automatically publishing all objects?

Hi @MattyBalaam, you could add a temporary controller (or an action on an existing controller), and write some code to publish the object in question.

foreach (MyObject::get() as $obj) {
    $obj-> publish('Stage', 'Live');
}

I haven't tested this code, but it might work.