#26 - Loading animation + success message fix

This commit was merged in pull request #31.
This commit is contained in:
Martin Slachta
2026-06-22 11:20:28 +02:00
parent c754e18a82
commit 97ee8fc991
32 changed files with 597 additions and 175 deletions
+18 -1
View File
@@ -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. */