Skip to content

Commit

Permalink
Fix PHP 8 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
qzminski committed Apr 13, 2022
1 parent 75fd2ae commit 7246af6
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions MPFormsFormManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -570,12 +570,12 @@ public function validateField(FormFieldModel $formField, $step)
if ($fakeValidation) {
Input::setPost($formField->name, null);
}

// Special hack for upload fields because they delete $_FILES and thus
// multiple validation calls will fail - sigh
if ($widget instanceof \uploadable && isset($_SESSION['FILES'][$widget->name])) {
$_FILES[$widget->name] = $_SESSION['FILES'][$widget->name];
}
}

return !$widget->hasErrors();
}
Expand Down Expand Up @@ -780,6 +780,12 @@ private function createDummyForm()
{
$form = new stdClass();
$form->form = $this->formModel->id;

// Set properties to avoid a warning "Undefined property: stdClass::$variable"
$form->headline = null;
$form->typePrefix = null;
$form->cssID = null;

return new Form($form);
}

Expand Down

0 comments on commit 7246af6

Please # to comment.