#26 - Loading animation + success message fix
This commit was merged in pull request #31.
This commit is contained in:
@@ -35,7 +35,24 @@ class RsvFormSubmission {
|
||||
return ['success' => false, 'errors' => $result->getErrors()];
|
||||
}
|
||||
|
||||
return ['success' => true, 'submit_id' => $submit_id, 'values' => $result->getValues()];
|
||||
global $rsv_template_registry;
|
||||
$message = trim($definition->getSuccessMessage());
|
||||
if ($message !== '') {
|
||||
$allowed = $rsv_template_registry->kses_allowed(wp_kses_allowed_html('post'));
|
||||
$template = wp_kses($message, $allowed);
|
||||
} else {
|
||||
$template = '';
|
||||
}
|
||||
|
||||
$data = array_merge($result->getValues(), (new RsvFormCalculatedValues())->for($definition, $form_data));
|
||||
|
||||
try {
|
||||
$submit_repo->set_computed($submit_id, $data);
|
||||
} catch (\Throwable $e) {
|
||||
Logger::error($e);
|
||||
}
|
||||
|
||||
return ['success' => true, 'submit_id' => $submit_id, 'template' => $template, 'data' => $data];
|
||||
}
|
||||
|
||||
/** Remove a submission whose run failed. */
|
||||
|
||||
Reference in New Issue
Block a user