Closed flack closed 2 years ago
I've added this as a local workaround for now:
add_filter('give_get_set_goal', function ($goal) {
return $goal ?: 0;
});
Ah, that makes sense. I'm ok with setting the form property, but want to make sure a non-null value wouldn't cause issues elsewhere. @ravinderk, what do you think?
Ah, that makes sense. I'm ok with setting the form property but want to make sure a non-null value wouldn't cause issues elsewhere. @ravinderk, what do you think?
@JasonTheAdams we use the goal process in frontend and backend. I will review the issue with PHP 8.0.
This issue has been linked to a Canny post: Using PHP 8 with Currency Switcher and Fee Recovery activated, Recount Stats Throws a Critical Error. :tada:
This issue has been unlinked from a Canny post: Using PHP 8 with Currency Switcher and Fee Recovery activated, Recount Stats Throws a Critical Error. :cry:
_give_set_goal
to 0
in form meta table
User Story
As a developer, I want to show progress stats for forms
Details
I have the following code
Expected Behavior
I get the
$stats
array with the data I'm looking formSteps to Reproduce
If
$form
has no goal set, i.e.$form->goal
isnull
, then the following fatal error is thrown in PHP 8:Additional Context
If I change this line:
https://github.com/impress-org/givewp/blob/1d802eefd48522df866240235b532a72183104d2/includes/class-give-donate-form.php#L93
to look like this:
Then the error goes away. I don't know if this is the correct fix though
System Information
Details
### Server Environment ### Hosting Provider: DBH: localhost, SRV: rfp TLS Connection: Verbindung verwendet TLS 1.3 TLS Connection: Probably Okay Server Info: Apache/2.4.48 (Ubuntu) PHP Version: 8.0.8 PHP Post Max Size: 8 MB PHP Time Limit: 30 PHP Max Input Vars: 1000 PHP Max Upload Size: 2 MB cURL Version: 7.74.0, OpenSSL/1.1.1l SUHOSIN Installed: – MySQL Version: 8.0.26 Default Timezone is UTC: ✔ fsockopen/cURL: ✔ SoapClient: ❌Dein Server hat die Klasse SoapClient nicht aktiviert - manche Gateway-Plugins, die SOAP benutzen, werden nicht wie erwartet funktionieren. DOMDocument: ✔ gzip: ✔ GD Graphics Library: ✔ Multibyte String: ✔ Remote Post: ✔ Remote Get: ✔Acceptance Criteria
I really don't understand how this section is supposed to work..