- Trạng thái
- Đã giải quyết
- Được báo cáo cho
- WPForms Multilingual 0.3.0
- Đã giải quyết trong
- 0.3.1
- Plugin/giao diện liên quan
- WP Forms
- Thẻ chủ đề
- Compatibility
Tổng quan về lỗi
Nếu bạn có một biểu mẫu với các hộp kiểm được tạo bằng plugin WPForms đang chạy trên máy chủ PHP 8x, biểu mẫu đó sẽ không hoạt động khi bạn cố gắng gửi đi. Thay vào đó, bạn sẽ gặp lỗi nghiêm trọng sau:
[14-Feb-2023 18:43:45 UTC] PHP Fatal error: Uncaught TypeError: array_key_exists(): Argument #1 ($key) must be a valid array offset type in …/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/Obj.php:98Stack trace: #5 …/wp-content/plugins/wpml-wpforms/classes/Hooks/WpForms/Strings.php(191): WPML\FP\Obj::__callStatic('propOr’, Array)#6 [internal function]: WPML\Forms\Hooks\WpForms\Strings->WPML\Forms\Hooks\WpForms\{closure}(Array, 44)#17 …/wp-content/plugins/wpml-wpforms/classes/Hooks/WpForms/Strings.php(197): WPML\FP\Obj::__callStatic('over’, Array)#18 …/wp-includes/class-wp-hook.php(308): WPML\Forms\Hooks\WpForms\Strings->translateEntry(Array, Array)
Giải pháp tạm thời
Vui lòng đảm bảo tạo một bản sao lưu đầy đủ trước khi tiếp tục.
- Mở tệp …/wp-content/plugins/wpml-wpforms/classes/Hooks/WpForms/Strings.php.
- Tìm dòng 185.
- Thay thế:
if ( in_array( Obj::path( [ 'fields', $fieldId, 'type' ], $originalForm ), [ 'checkbox', 'radio', 'select' ], true ) ) {Bằng:
if ( in_array( Obj::path( [ 'fields', $fieldId, 'type' ], $originalForm ), [ 'radio', 'select' ], true ) ) {