Small change for php7 compatibility

Permalink Browser Info Environment
For anyone updating to php7:

core_commerce_gift_cards/models/core_commerce/payment/methods/gift_cards/controller.php
Line:15    public function on_start($task=null) { // php7 compatibility


(Anyone implementing this on a site will also need to update eCommerce, and that has a lot of php7 incompatibilities)

Type: Pre-Sale
Status: In Progress
JohntheFish
View Replies:
JohntheFish replied on at Permalink Reply
JohntheFish
For php7.2 compatibility while maintaining backward compatibility further changes are needed

packages/core_commerce_gift_cards/controller.php
// at end
if(!class_exists('ConcreteObject') && class_exists('Object')){
    class ConcreteObject extends Object {}
}


models/core_commerce/payment/coupon/delivery/method.php
class CoreCommercePaymentCouponDeliveryMethod extends ConcreteObject 
models/core_commerce/payment/coupon/transaction/queue_item.php
class CoreCommercePaymentCouponTransactionQueueItem extends ConcreteObject 
models/core_commerce/payment/coupon/transaction/queue.php
class CoreCommercePaymentCouponTransactionQueue extends ConcreteObject 
models/core_commerce/payment/coupon/transaction/model.php
class CoreCommercePaymentCouponTransaction extends ConcreteObject 
models/core_commerce/payment/coupon/set_limitation.php
class CoreCommercePaymentCouponSetLimitation extends ConcreteObject 
models/core_commerce/payment/coupon/set.php
class CoreCommercePaymentCouponSet extends ConcreteObject 
models/core_commerce/payment/coupon/set_product.php
class CoreCommercePaymentCouponSetProduct extends ConcreteObject 
models/core_commerce/payment/coupon/model.php
Mainio replied on at Permalink Reply
Mainio
Thanks a lot John for these!

I cannot find an official release of legacy concrete5 that supports PHP7.2. The latest available version (5.6.3.5) still seems to ship with the "Object" class, although the changes have been made in the GitHub version.

I guess these changes need to be implemented by hand in case someone still needs to maintain a legacy site.
JohntheFish replied on at Permalink Reply
JohntheFish
c5.6 core php7.2 compatibility is on the 5.6 github and Portland Labs have promised to release it as 5.6.4 as an end of life release.

All the class name changes are not backward compatible in themselves. But adding the code below then makes it backward compatible
if(!class_exists('ConcreteObject') && class_exists('Object')){
    class ConcreteObject extends Object {}
}

concrete5 Environment Information

5.6.4 (github, pre-release)
php7

Browser User-Agent String

Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.146 Safari/537.36

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You may not request a refund that is not currently owned by you.