דלג על הניווט

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 תגובות אל “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

השאר תגובה

אנא הישאר בנושא והיה מכבד כלפי אחרים. אם אתה זקוק לעזרה בנושאים שאינם קשורים לפוסט זה, השתמש בפורום התמיכה שלנו כדי להתחיל צ'אט או לשלוח כרטיס.

אתה יכול להשתמש בתגים אלה:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>