Chuyển đến nội dung Chuyển đến thanh bên

Waiting for author

Topic Tags: Compatibility

Overview of the issue

When attempting to translate a Give – Donation plugin form, a fatal error occurs rather than opening the translation editor:

PHP Fatal error: Uncaught TypeError: array_filter(): Argument #1 ($array) must be of type array, string given in .../wp-content/plugins/sitepress-multilingual-cms/classes/translation-jobs/class-wpml-element-translation-package.php:318

Workaround

Please, make sure of having a full backup of your site before proceeding.

  • Open …/wp-content/plugins/give/includes/database/class-give-db-meta.php file.
  • Look for line 151.
  • Replace:
    		if ( $this->raw_result ) {
    			if ( ! ( $value = get_metadata( $this->meta_type, $id, $meta_key, false ) ) ) {
    				$value = '';
    			}
    
  • With:
    		if ( $this->raw_result ) {
    			if ( ! ( $value = get_metadata( $this->meta_type, $id, $meta_key, false ) ) ) {
    				$value = array();
    			}
    

6 phản hồi đến “Give - Donation - Fatal error when trying to update or translate a form”

  1. Hi, I am having the same issue and tried your workaround. This caused the following error message to appear on the donation form. Warning: Undefined array key 0 in /home/httpd/vhosts/internationalbluecross.org/httpdocs/wp-includes/meta.php on line 638
    My website is internationalbluecross.org It is running on php version 8.1.23

    Thanks for any further help, Sabra

  2. I have tha same issue.

    The give form in Arabic language not work.

    I try the same workaround and do not fix. And recieve the same error msg:

    PHP Warning: Undefined array key 0 in /home/wp-includes/meta.php on line 638

Để lại trả lời

Vui lòng giữ đúng chủ đề và tôn trọng người khác. Nếu bạn cần trợ giúp với các vấn đề không liên quan đến bài đăng này, hãy sử dụng Diễn đàn Hỗ trợ của chúng tôi để bắt đầu trò chuyện hoặc gửi vé hỗ trợ.

Bạn có thể sử dụng các thẻ này:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>