ื“ืœื’ ืœืชื•ื›ืŸ ื“ืœื’ ืœืกืจื’ืœ ืฆื“

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

ื”ืฉืืจ ืชื’ื•ื‘ื”

ืื ื ื”ื™ืฉืืจ ื‘ื ื•ืฉื ื•ื”ื™ื” ืžื›ื‘ื“ ื›ืœืคื™ ืื—ืจื™ื. ืื ืืชื” ื–ืงื•ืง ืœืขื–ืจื” ื‘ื ื•ืฉืื™ื ืฉืื™ื ื ืงืฉื•ืจื™ื ืœืคื•ืกื˜ ื–ื”, ื”ืฉืชืžืฉ ื‘ืคื•ืจื•ื ื”ืชืžื™ื›ื” ืฉืœื ื• ื›ื“ื™ ืœื”ืชื—ื™ืœ ืฆ'ืื˜ ืื• ืœืฉืœื•ื— ื›ืจื˜ื™ืก.

ืืชื” ื™ื›ื•ืœ ืœื”ืฉืชืžืฉ ื‘ืชื’ื™ื ืืœื”:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>