- Status
- Gelöst
- Gemeldet für
- WPForms Multilingual 0.3.5
- Gelöst in
- WPForms Multilingual 0.3.6
- Themen-Tags
- Compatibility
Übersicht über das Problem
Wenn Sie WPForms verwenden und kürzlich auf 1.8.5.1 aktualisiert haben, stoßen Sie möglicherweise auf den folgenden Fehler in Ihren debug.log-Informationen, wenn Ihre Website in einer PHP8-Umgebung läuft:
PHP Fatal error: Uncaught TypeError: strlen(): Argument #1 ($str) must be of type string, array given in .../wp-includes/formatting.php:3557
Problemumgehung
Kunden, bei denen dieses Problem auftritt, wird empfohlen, auf WPForms 1.8.4 zurückzukehren, bis eine Fehlerbehebung veröffentlicht wird.
Stellen Sie andernfalls bitte sicher, dass Sie über ein vollständiges Backup Ihrer Website verfügen, bevor Sie fortfahren.
- Öffnen Sie die Datei …/wp-content/plugins/wpml-wpforms/classes/Hooks/WpForms/Notifications.php.
- Suchen Sie nach Zeile 70.
- Ändern Sie:
public function applyEmailTranslations( $data, $emails ) { $package = $this->newPackage( $this->getId( $emails->form_data ) ); do_action( 'wpml_switch_language_for_email', $data['to'] ); $dataKeys = [ 'subject', 'message' ]; - In:
public function applyEmailTranslations( $data, $emails ) { $package = $this->newPackage( $this->getId( $emails->form_data ) ); if (is_array($data['to'])){ foreach ($data['to'] as $address){ do_action( 'wpml_switch_language_for_email', $address ); } } else { do_action( 'wpml_switch_language_for_email', $data['to'] ); } $dataKeys = [ 'subject', 'message' ];