TransWikia.com

Undefined index: rule_id when trying to create a cart rule (coupons) after upgrading from magento 2.1 to 2.3.5

Magento Asked by deicul on January 23, 2021

When upgrading from 2.1 to 2.3.5, I am now getting the following error when I try to create a new cart rule:

[2020-09-19 15:53:49] main.CRITICAL: Notice: Undefined index: rule_id in /var/www/html/magento2/vendor/stripe/module-payments/Observer/CouponEditObserver.php on line 29 {"exception":"[object] (Exception(code: 0): Notice: Undefined index: rule_id in /var/www/html/magento2/vendor/stripe/module-payments/Observer/CouponEditObserver.php on line 29 at /var/www/html/magento2/vendor/magento/framework/App/ErrorHandler.php:61)"} []

I emailed stripe support and they’ve told me it’s not them.
Any help would be appreciated. Thank you.

One Answer

This error related to Stripe Payment extension, when you upgrade Magento from 2.1 to 2.3.5, you have to change PHP version to 7.2 or 7.3 then the error will be happened. The easy way is change the code around line 29 in vendor/stripe/module-payments/Observer/CouponEditObserver.php

if (!isset($data['rule_id']) || !is_numeric($data['rule_id']))
        return;

instead of

if (!is_numeric($data['rule_id']))
        return;

Answered by Hieu on January 23, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP