Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: prevent fatal error during form migration #7197

Merged
merged 3 commits into from
Jan 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions give.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Description: The most robust, flexible, and intuitive way to accept donations on WordPress.
* Author: GiveWP
* Author URI: https://givewp.com/
* Version: 3.3.0
* Version: 3.3.1
* Requires at least: 6.0
* Requires PHP: 7.2
* Text Domain: give
Expand Down Expand Up @@ -403,7 +403,7 @@ private function setup_constants()
{
// Plugin version.
if (!defined('GIVE_VERSION')) {
define('GIVE_VERSION', '3.3.0');
define('GIVE_VERSION', '3.3.1');
}

// Plugin Root File.
Expand Down
7 changes: 5 additions & 2 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Tags: donation, donate, recurring donations, fundraising, crowdfunding
Requires at least: 6.0
Tested up to: 6.4
Requires PHP: 7.2
Stable tag: 3.3.0
Stable tag: 3.3.1
License: GPLv3
License URI: http://www.gnu.org/licenses/gpl-3.0.html

Expand Down Expand Up @@ -262,7 +262,10 @@ The 2% fee on Stripe donations only applies to donations taken via our free Stri
10. Use almost any payment gateway integration with GiveWP through our add-ons or by creating your own add-on.

== Changelog ==
= 3.3.0: Jan 10th, 2024 =
= 3.3.1: January 23rd, 2024 =
* Fix: Resolved an issue checking for the GiveWP Funds and Designations add-on information during form migrations

= 3.3.0: January 10th, 2024 =
* Happy new year!
* Fix: Resolved an issue where some migrated forms were being duplicated
* Fix: Resolved an issue with the donor export filter by donation form
Expand Down
7 changes: 4 additions & 3 deletions src/FormMigration/FormMetaDecorator.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
use Give\DonationForms\V2\Models\DonationForm;
use Give\DonationForms\ValueObjects\GoalType;
use Give\FormMigration\Contracts\FormModelDecorator;
use Give\Log\Log;
use Give\PaymentGateways\Gateways\Stripe\StripePaymentElementGateway\StripePaymentElementGateway;
use Give_Email_Notification_Util;

Expand Down Expand Up @@ -599,23 +598,25 @@ private function getMeta(string $key, $default = null)
}

/**
* @since 3.3.1 changed how is checked if the form has funds
* @since 3.3.0
*/
public function hasFunds(): bool
{
$fundsAndDesignationsAttributes = $this->getFundsAndDesignationsAttributes();

return count($fundsAndDesignationsAttributes['fund']) > 0;
return !empty($fundsAndDesignationsAttributes['fund']);
pauloiankoski marked this conversation as resolved.
Show resolved Hide resolved
}

/**
* @since 3.3.1 changed how is checked if the form has fund options
* @since 3.3.0
*/
public function hasFundOptions(): bool
{
$fundsAndDesignationsAttributes = $this->getFundsAndDesignationsAttributes();

return count($fundsAndDesignationsAttributes['options']) > 0;
return !empty($fundsAndDesignationsAttributes['options']);
pauloiankoski marked this conversation as resolved.
Show resolved Hide resolved
}

/**
Expand Down
Loading