1 <?php
2
3 4 5 6 7 8 9 10 11
12
13 class UserFormsVersionedTask extends MigrationTask {
14
15 protected $title = "UserForms Versioned Initial Migration";
16
17 protected $description = "Publishes the existing forms";
18
19 20 21 22
23 function run($request) {
24 $forms = Versioned::get_by_stage('UserDefinedForm', 'Live');
25
26 if($forms) {
27 foreach($forms as $form) {
28 echo "Publishing $form->Title <br />";
29 $form->doPublish();
30 }
31 echo "Complete";
32 }
33 else {
34 echo "No Forms Found";
35 }
36 }
37 }
38
39
40
[Raise a SilverStripe Framework issue/bug](https://github.com/silverstripe/silverstripe-framework/issues/new)
- [Raise a SilverStripe CMS issue/bug](https://github.com/silverstripe/silverstripe-cms/issues/new)
- Please use the
Silverstripe Forums to ask development related questions.
-