GiveWP should not be throwing fatal errors
complete
Ben Meredith
We have several reports of GiveWP 2.9.3 throwing a specific fatal error in certain situations. We're working to replicate it (unsuccessfully so far) but in the meantime want to keep track of all occurrences. The error is:
An error of type E_ERROR was caused in line 32 of the file ...give/src/Revenue/Listeners/DeleteRevenueWhenDonationDeleted.php. Error message: Uncaught ArgumentCountError: Too few arguments to function Give\Revenue\Listeners\DeleteRevenueWhenDonationDeleted::__invoke(), 1 passed and exactly 2 expected in .../give/src/Revenue/Listeners/DeleteRevenueWhenDonationDeleted.php:32
All users having this error should comment here with steps for our team to replicate the problem.
Jason Adams
complete
This has been resolved in the new 2.9.4 release.
Ben Meredith
Our team has isolated the issue here, and it will be resolved soon. Here's the reason this is happening, and the workaround:
In WordPress version 5.5, a second parameter was added to the delete_post action. This action runs when you try to delete posts, pages, and custom post types. It also runs in some cases when some pagebuilders save posts and pages.
A method within GiveWP uses that action in a way that is compatible with WordPress 5.5, but not backward compatible to previous versions. We're going to fix that very soon.
In the meantime, the fix is to update your sites to WordPress 5.5+
Thanks for all the reports of this. We look forward to resolving this very soon.
Big Bang Tech
Ben Meredith: I'm on wp5.7 and give 2.10.1 and I also am getting the fatal errors after paying for donations. I also do not receive any error emails, and donor is not receiving donation emails even though all email settings look good
Big Bang Tech
This is my php error log:
[03-Apr-2021 00:48:02 UTC] PHP Notice: Undefined index: date in /home/distort2/public_html/wp-content/plugins/give/src/Session/SessionDonation/DonationAccessor.php on line 64
[03-Apr-2021 00:48:02 UTC] PHP Notice: Undefined index: donorInfo in /home/distort2/public_html/wp-content/plugins/give/src/Session/SessionDonation/SessionObjects/Donation.php on line 100
[03-Apr-2021 00:48:02 UTC] PHP Warning: array_key_exists() expects parameter 2 to be array, null given in /home/distort2/public_html/wp-content/plugins/give/src/Helpers/ArrayDataSet.php on line 23
[03-Apr-2021 00:48:02 UTC] PHP Warning: array_key_exists() expects parameter 2 to be array, null given in /home/distort2/public_html/wp-content/plugins/give/src/Helpers/ArrayDataSet.php on line 23
[03-Apr-2021 00:48:02 UTC] PHP Notice: Undefined index: cardInfo in /home/distort2/public_html/wp-content/plugins/give/src/Session/SessionDonation/SessionObjects/Donation.php on line 101
[03-Apr-2021 00:48:02 UTC] PHP Warning: Invalid argument supplied for foreach() in /home/distort2/public_html/wp-content/plugins/give/src/Session/SessionDonation/SessionObjects/Donation.php on line 170
[03-Apr-2021 00:48:02 UTC] PHP Warning: array_key_exists() expects parameter 2 to be array, null given in /home/distort2/public_html/wp-content/plugins/give/src/Helpers/ArrayDataSet.php on line 23
[03-Apr-2021 00:48:02 UTC] PHP Warning: array_key_exists() expects parameter 2 to be array, null given in /home/distort2/public_html/wp-content/plugins/give/src/Helpers/ArrayDataSet.php on line 23
[03-Apr-2021 00:48:02 UTC] PHP Warning: array_key_exists() expects parameter 2 to be array, null given in /home/distort2/public_html/wp-content/plugins/give/src/Helpers/ArrayDataSet.php on line 59
[03-Apr-2021 00:48:02 UTC] PHP Warning: array_key_exists() expects parameter 2 to be array, null given in /home/distort2/public_html/wp-content/plugins/give/src/Helpers/ArrayDataSet.php on line 59
[03-Apr-2021 00:48:02 UTC] PHP Warning: array_key_exists() expects parameter 2 to be array, null given in /home/distort2/public_html/wp-content/plugins/give/src/Helpers/ArrayDataSet.php on line 59
[03-Apr-2021 00:48:02 UTC] PHP Warning: array_key_exists() expects parameter 2 to be array, null given in /home/distort2/public_html/wp-content/plugins/give/src/Helpers/ArrayDataSet.php on line 59
[03-Apr-2021 00:48:02 UTC] PHP Warning: array_key_exists() expects parameter 2 to be array, null given in /home/distort2/public_html/wp-content/plugins/give/src/Helpers/ArrayDataSet.php on line 59
[03-Apr-2021 00:48:02 UTC] PHP Warning: array_key_exists() expects parameter 2 to be array, null given in /home/distort2/public_html/wp-content/plugins/give/src/Helpers/ArrayDataSet.php on line 59
[03-Apr-2021 00:48:02 UTC] PHP Notice: Trying to access array offset on value of type null in /home/distort2/public_html/wp-content/plugins/give/src/Session/SessionDonation/SessionObjects/Donation.php on line 155
[03-Apr-2021 00:48:02 UTC] PHP Notice: Trying to access array offset on value of type null in /home/distort2/public_html/wp-content/plugins/give/src/Session/SessionDonation/SessionObjects/Donation.php on line 155
[03-Apr-2021 00:48:02 UTC] PHP Warning: array_intersect_key(): Expected parameter 1 to be an array, null given in /home/distort2/public_html/wp-content/plugins/give/src/ValueObjects/DonorInfo.php on line 61
[03-Apr-2021 00:48:02 UTC] PHP Fatal error: Uncaught InvalidArgumentException: Invalid DonorInfo object, must have the exact following keys: wpUserId, firstName, email, honorific, address in /home/distort2/public_html/wp-content/plugins/give/src/ValueObjects/DonorInfo.php:64
Stack trace:
#0 /home/distort2/public_html/wp-content/plugins/give/src/Session/SessionDonation/SessionObjects/Donation.php(106): Give\ValueObjects\DonorInfo::fromArray(NULL)
#1 /home/distort2/public_html/wp-content/plugins/give/src/Session/SessionDonation/DonationAccessor.php(77): Give\Session\SessionDonation\SessionObjects\Donation::fromArray(Array)
#2 /home/distort2/public_html/wp-content/plugins/give/src/Session/Accessor.php(139): Give\Session\SessionDonation\DonationAccessor->convertToObject(Array)
#3 /home/distort2/public_html/wp-content/plugins/give/src/Session/Accessor.php(128): Give\Session\Accessor->set()
#4 /home/distort2/public_html/wp-content/plugins/give/src/Helpers/Frontend/ConfirmDonation.php(33): Give\Session\Accessor->store('postDataForPayp...', Array)
#5 /home/dis in /home/distort2/public_html/wp-content/plugins/give/src/ValueObjects/DonorInfo.php on line 64
Ravinder Kumar
in progress