Skip to content

Commit

Permalink
Get forms in a different way to fix the pull request migrations
Browse files Browse the repository at this point in the history
  • Loading branch information
Hubert Prein committed Oct 19, 2016
1 parent 82be82f commit 05e2d82
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion migrations/m161005_122600_amforms_editFormSettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down

0 comments on commit 05e2d82

Please sign in to comment.