From bedb0e14e893f697c46bc20a6459ce506e02dfca Mon Sep 17 00:00:00 2001 From: Genevieve-K <34507086+Genevieve-K@users.noreply.github.com> Date: Thu, 20 Jun 2024 13:06:45 +0200 Subject: [PATCH 1/2] Update give-export-donations-exporter.php The meta 'razorpay_donation_response' is an array. Must be serialized to avoid a fatal error: TypeError: Uncaught TypeError: substr(): Argument #1 ($string) must be of type string, array given in /var/www/html/wordpress/wp-content/plugins/give/includes/admin/tools/export/give-export-donations-exporter.php:684 --- includes/admin/tools/export/give-export-donations-exporter.php | 1 + 1 file changed, 1 insertion(+) diff --git a/includes/admin/tools/export/give-export-donations-exporter.php b/includes/admin/tools/export/give-export-donations-exporter.php index fd839c3bcb..148df5c4a1 100644 --- a/includes/admin/tools/export/give-export-donations-exporter.php +++ b/includes/admin/tools/export/give-export-donations-exporter.php @@ -663,6 +663,7 @@ public function print_csv_rows() { foreach ( $row as $col_id => $column ) { // Make sure the column is valid if ( array_key_exists( $col_id, $cols ) ) { + $column = maybe_serialize( $column ); $row_data .= '"' . $this->escape_csv_cell_data(preg_replace( '/"/', "'", $column )) . '"'; $row_data .= $i == count( $cols ) ? '' : ','; $i ++; From 6c7ed34c32bc6f70f07aa65c14eb754c060a48a5 Mon Sep 17 00:00:00 2001 From: Genevieve-K <34507086+Genevieve-K@users.noreply.github.com> Date: Tue, 25 Jun 2024 22:55:19 +0200 Subject: [PATCH 2/2] Update give-export-donations-exporter.php --- includes/admin/tools/export/give-export-donations-exporter.php | 1 + 1 file changed, 1 insertion(+) diff --git a/includes/admin/tools/export/give-export-donations-exporter.php b/includes/admin/tools/export/give-export-donations-exporter.php index 148df5c4a1..ded3eb229e 100644 --- a/includes/admin/tools/export/give-export-donations-exporter.php +++ b/includes/admin/tools/export/give-export-donations-exporter.php @@ -646,6 +646,7 @@ public function get_percentage_complete() { * @access public * * @since 2.1 + * @unreleased Use maybe_serialize() for column data (some data are arrays) * * @return string|false */