SMF icon indicating copy to clipboard operation
SMF copied to clipboard

Unsupported operand types: string + string while updating subscription

Open unnilennium opened this issue 2 years ago • 8 comments

Description

using SMF 2.0.19 subscriptions enabled

Steps to reproduce

  1. edit one user subscription
  2. change from finished to Active
  3. 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)

unnilennium avatar Feb 05 '23 05:02 unnilennium

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.

Oldiesmann avatar Feb 11 '23 03:02 Oldiesmann

requirements are not quite clear about that : https://download.simplemachines.org/requirements.php what is the highest php supported ?

unnilennium avatar Feb 11 '23 05:02 unnilennium

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.

m4z avatar Feb 11 '23 08:02 m4z

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: @.***>

live627 avatar Feb 11 '23 09:02 live627

What are you referring to?

m4z avatar Feb 12 '23 07:02 m4z

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.

unnilennium avatar Feb 12 '23 11:02 unnilennium

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.

jdarwood007 avatar Feb 12 '23 17:02 jdarwood007

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.

sbulen avatar Feb 12 '23 18:02 sbulen