| @@ -126,8 +126,9 @@ | ||
| 126 | 126 | */ |
| 127 | 127 | protected function resolveOtherOption($fieldValue, $fieldName, $otherText) |
| 128 | 128 | { |
| 129 | 129 | $otherMarker = '__ff_other_' . $fieldName . '__'; |
| 130 | + $otherText = trim($otherText); | |
| 130 | 131 | |
| 131 | 132 | // Empty "Other": remove the marker. |
| 132 | 133 | if ('' === $otherText) { |
| 133 | 134 | if (is_array($fieldValue)) { |
| @@ -327,9 +328,13 @@ | ||
| 327 | 328 | if (empty($form->settings)) { |
| 328 | 329 | $formSettings = FormMeta::retrieve('formSettings', $form->id); |
| 329 | 330 | $form->settings = is_array($formSettings) ? $formSettings : []; |
| 330 | 331 | } |
| 331 | - $confirmation = $form->settings['confirmation']; | |
| 332 | + // A form written outside the editor may carry no confirmation block; the editor defaults apply | |
| 333 | + $confirmation = Arr::get($form->settings, 'confirmation'); | |
| 334 | + if (!$confirmation) { | |
| 335 | + $confirmation = Arr::get(Form::getFormsDefaultSettings(), 'confirmation', []); | |
| 336 | + } | |
| 332 | 337 | $confirmation = apply_filters_deprecated( |
| 333 | 338 | 'fluentform_form_submission_confirmation', |
| 334 | 339 | [ |
| 335 | 340 | $confirmation, |
| @@ -348,9 +353,9 @@ | ||
| 348 | 353 | $form |
| 349 | 354 | ); |
| 350 | 355 | if ('samePage' == Arr::get($confirmation, 'redirectTo')) { |
| 351 | 356 | |
| 352 | - $confirmation['messageToShow'] = fluentform_sanitize_html($confirmation['messageToShow']); | |
| 357 | + $confirmation['messageToShow'] = fluentform_sanitize_html(Arr::get($confirmation, 'messageToShow', '')); | |
| 353 | 358 | |
| 354 | 359 | $confirmation['messageToShow'] = apply_filters_deprecated( |
| 355 | 360 | 'fluentform_submission_message_parse', |
| 356 | 361 | [ |
| @@ -380,14 +385,14 @@ | ||
| 380 | 385 | $message = $message ? $message : __('The form has been successfully submitted.', 'fluentform'); |
| 381 | 386 | |
| 382 | 387 | $returnData = [ |
| 383 | 388 | 'message' => $message, |
| 384 | - 'action' => $confirmation['samePageFormBehavior'], | |
| 389 | + 'action' => Arr::get($confirmation, 'samePageFormBehavior', 'hide_form'), | |
| 385 | 390 | ]; |
| 386 | 391 | } else { |
| 387 | 392 | $redirectUrl = Arr::get($confirmation, 'customUrl'); |
| 388 | - if ('customPage' == $confirmation['redirectTo']) { | |
| 389 | - $redirectUrl = get_permalink($confirmation['customPage']); | |
| 393 | + if ('customPage' === Arr::get($confirmation, 'redirectTo')) { | |
| 394 | + $redirectUrl = get_permalink(Arr::get($confirmation, 'customPage')); | |
| 390 | 395 | } |
| 391 | 396 | $enableQueryString = Arr::get($confirmation, 'enable_query_string') === 'yes'; |
| 392 | 397 | $queryStrings = Arr::get($confirmation, 'query_strings'); |
| 393 | 398 | |