diff --git a/migrations/m161005_122600_amforms_editFormSettings.php b/migrations/m161005_122600_amforms_editFormSettings.php index 0e10fda..3d17e87 100644 --- a/migrations/m161005_122600_amforms_editFormSettings.php +++ b/migrations/m161005_122600_amforms_editFormSettings.php @@ -17,9 +17,14 @@ public function safeUp() $this->addColumnAfter('amforms_forms', 'afterSubmit', AttributeType::String, 'submitButton'); // Update existing forms - $forms = craft()->amForms_forms->getAllForms(); + $forms = craft()->db->createCommand() + ->select('*') + ->from('amforms_forms') + ->queryAll(); if ($forms) { foreach ($forms as $form) { + $form = AmForms_FormModel::populateModel($form); + // Set afterSubmit if (! empty($form->afterSubmitText)) { $form->afterSubmit = 'afterSubmitText';