Skip to content

Commit

Permalink
Fix: prevent fatal error during form migration (#7197)
Browse files Browse the repository at this point in the history
Co-authored-by: Jon Waldstein <jonwaldstein@jons-air.mynetworksettings.com>
  • Loading branch information
pauloiankoski and Jon Waldstein authored Jan 23, 2024
1 parent a4416a0 commit fa8c05b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
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']);
}

/**
* @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']);
}

/**
Expand Down

0 comments on commit fa8c05b

Please sign in to comment.