Unsupported operand types: string + string while updating subscription
Description
using SMF 2.0.19 subscriptions enabled
Steps to reproduce
- edit one user subscription
- change from finished to Active
- validate result Unsupported operand types: string + string
Environment (complete as necessary)
- Version/Git revision: SMF 2.0.19 Database Server: MariaDB MySQL version: 10.6.9-MariaDB PHP: 8.0.26
Additional information/references
since upgrading to php 8.0 I also stop recieving any email about New Paid Subscription (I can also open an issue if you want)
PHP 8.x isn't officially supported by 2.0, so this may or may not get fixed in the future. It should work properly in 2.1 though.
requirements are not quite clear about that : https://download.simplemachines.org/requirements.php what is the highest php supported ?
As far as I can tell, PHP 8.0 is officially supported in 2.0.x (but 8.1 is not): https://wiki.simplemachines.org/smf/SMF2.0:Requirements_and_recommendations
But since 2.0.x is security fixes only, it probably won't be fixed. Consider upgrading to 2.1.x.
Maybe that's not such a good idea
On Sat, Feb 11, 2023 at 1:53 AM m4z @.***> wrote:
As far as I can tell, 8.0 ia officially supported (but 8.1 is not): https://wiki.simplemachines.org/smf/SMF2.0:Requirements_and_recommendations
— Reply to this email directly, view it on GitHub https://github.com/SimpleMachines/SMF/issues/7683#issuecomment-1426665066, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADJNN56DDSIEUGPZHQGH5LWW5HRFANCNFSM6AAAAAAURSLTJY . You are receiving this because you are subscribed to this thread.Message ID: @.***>
What are you referring to?
thank you for pointing the right page. While this is not the purpose of this ticket only the one i pointed is found in search engines. maybe link to the 2.0 and 2.1 page from there would help :)
so reading this requirements and php8.0 is supported. this is a bug.
https://github.com/SimpleMachines/SMF/blob/release-2.1/Sources/Subscriptions-PayPal.php#L374
I assume from a quick glance, this may be the affected code. Its possible they are being interrupted as strings rather than floats. We may need to force a cast.
return (isset($_POST['tax']) ? (float) $_POST['tax'] : 0) + (float) $_POST['mc_gross'];
This is the only code I saw in in this file and in the relevant code in Profile-Actions for subscriptions that seems to be joining two variables in PHP.
Has this been reproduced in 2.1?
As noted before, 2.0 is getting security fixes only.
If this is a 2.0-only issue, we should close this out.