PluginProbe
The Innovative Form Builder – IvyForms / 1.5
The Innovative Form Builder – IvyForms v1.5
1.5.1 1.5 1.4.1 1.4 trunk 0.1.2 0.2 0.2.1 0.3 0.3.1 0.4 0.5 0.6 0.6.1 0.6.1-backup 0.6.1.1 0.7 0.8 0.8.1 0.8.2 0.9 0.9.1 1.0 1.1 1.1.1 All 27 releases
← All changes | backend/src/Controllers/Form/GetFormController.php +5 -7 1.1 → 1.5 View file →
@@ -67,17 +67,15 @@
67 67 $form = $this->formService->getFormById($formId);
68 68 $fieldsMap = $this->fieldService->getAllFieldsWithOptions($form->getId());
69 69 $form->setFields($fieldsMap);
70 70
71 - $confirmationsArr = $this->confirmationService->getConfirmationsById($formId);
71 + $defaultConfirmationId = $this->confirmationService->ensureDefaultConfirmationExists($formId);
72 72
73 - $confirmations = [];
74 - foreach ($confirmationsArr as $confirmation) {
75 - $confirmations[] = $confirmation->toArray();
76 - }
77 -
78 73 return new WP_REST_Response([
79 74 'message' => BackendStrings::getCommonStrings()['ok'],
80 - 'data' => array_merge($form->toArray(), ['confirmationId' => $confirmations[0]['id']])
75 + 'data' => array_merge($form->toArray(), [
76 + 'confirmationId' => $defaultConfirmationId,
77 + 'submissionNonce' => wp_create_nonce('ivyformsFrontSubmissionNonce_' . $formId),
78 + ]),
81 79 ], 200);
82 80 }
83 81 }