WPML
Status
Waiting for author
Related plugin/theme
Give - Donation Plugin
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();
    			}

All known issues →