lekoala/silverstripe-mandrill

PHP 7.2 compatibility for version 2.0.0

HPiirainen opened this issue · 8 comments

SilverStripe 3.7.0 enabled PHP 7.2 support, but the 2.0.0 version of this plugin has references to Object, which is now a restricted keyword in PHP.

Is it possible for you to add a

if (!class_exists('SS_Object')) class_alias('Object', 'SS_Object');

check into the _config.php of the 2.0.0 version of this module?

done, i published 2.0.1 with the change

Great, thanks! Tried updating via Composer, but according to Packagist it looks like 2.0.1 is now requiring SS version ^4.0, not ~3.1 like 2.0.0.

actually, 2.0.0 was the first version to support ss4, so that is expected.

i believe you mean to add this change to branch 1

According to Packagist, 2.0.0 requires SS ~3.1, so that's the version I've been using in my SS 3.x sites without problems. Only in 3.0.0 it starts requiring SS4. The 2.0.0 README also declares compatibility with SS3.

But if 2.x is really meant for SS4, then I can also switch to using 1.x versions.

Actually about the change, I was following the instructions in https://docs.silverstripe.org/en/3/changelogs/3.7.0/#for-module-authors, but I missed the other part about replacing Object with SS_Object.

So adding PHP 7.2 compatibility will require also changing https://github.com/lekoala/silverstripe-mandrill/blob/1/code/MandrillMailer.php#L91-L92 to SS_Object in addition to the change I notified about earlier. Sorry about that.

About the versions, it looks like you're correct, I was referring to branch 1, but for some reason in Packagist version 2.0.0 is the same as branch 1 in GitHub.

ok done, let's see if we got it right this time

Downgraded to 1.1.6, everything seems to be in order now. Thanks!