WPML
الحالة
محلولة
أُبلغ عنها لـ
WPForms Multilingual 0.3.5
تم حلها في
WPForms Multilingual 0.3.6
وسوم الموضوع
Compatibility

نظرة عامة على المشكلة

إذا كنت تستخدم WPForms وقمت مؤخراً بالتحديث إلى 1.8.5.1، فقد تواجه الخطأ التالي في معلومات debug.log إذا كان موقعك يعمل في بيئة PHP8:

PHP Fatal error:  Uncaught TypeError: strlen(): Argument #1 ($str) must be of type string, array given in .../wp-includes/formatting.php:3557

حل بديل مؤقت

يُنصح العملاء الذين يواجهون هذه المشكلة بالعودة إلى WPForms 1.8.4 حتى يتم إصدار حل.

خلاف ذلك، يُرجى التأكد من أخذ نسخة احتياطية كاملة لموقعك قبل المتابعة.


  • افتح ملف …/wp-content/plugins/wpml-wpforms/classes/Hooks/WpForms/Notifications.php.

  • ابحث عن السطر 70.

  • غيّر:
    	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' ];

  • إلى:
    	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' ];

جميع المشاكل المعروفة →