forms not sent (since last update to CF7 – version 5.4)
-
since Update to v5.4. forms are not sent in some cases. In some cases it works, in some not. I rolled back to v5.3.2. – it seems to work again.
The log reports:
PHP Warning: Invalid argument supplied for foreach() in /homepages/8/d350113630/htdocs/WP_RECHT247_PRD/wp-content/themes/Avada-child/includes/wpcf7.php on line 253the appropriate code in /wpcf7.php is
…./** * Modify Ajax JSON response. Add custom error messages. * * @param $response * @param $result * @return mixed */ public function filterAjaxJsonEcho($response, $result) { $errors = []; foreach ($response['invalidFields'] as $key => $field) { $jsonReason = json_decode($field['message'], true); // Skip if it's simple text if (empty($jsonReason)) { continue; } $errors = array_unique(array_merge($errors, $jsonReason['errors'] ?? [])); // Field error message $message = $jsonReason['message'] ?? null; // Remove field if empty message if (empty($message)) { unset($response['invalidFields'][$key]); } else { $response['invalidFields'][$key]['message'] = $message; } }
….
line 253 is: foreach ($response[‘invalidFields’] as $key => $field) {
Viewing 11 replies - 1 through 11 (of 11 total)
Viewing 11 replies - 1 through 11 (of 11 total)
- The topic ‘forms not sent (since last update to CF7 – version 5.4)’ is closed to new replies.