Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

It comes the exception error when buying virtual product (php8) #61

Open
f123248 opened this issue Mar 8, 2023 · 0 comments
Open

It comes the exception error when buying virtual product (php8) #61

f123248 opened this issue Mar 8, 2023 · 0 comments

Comments

@f123248
Copy link

f123248 commented Mar 8, 2023

There are no shipping description when buying the virtual product so it wil comes up the exception error and crash the riskfied review flow.

The error happens at 586 of vendor/riskified/magento2new/Model/Api/Order/Helper.php

   public function getShippingLines()
    {
        return [
            [
                'price' => floatval($this->getOrder()->getShippingAmount()),
                'title' => strip_tags($this->getOrder()->getShippingDescription()),
                'code' => $this->getOrder()->getShippingMethod()
            ]
        ];
    }

It should be checked the value first in php 8

   public function getShippingLines()
   {
       return [
           [
               'price' => floatval($this->getOrder()->getShippingAmount()),
               'title' => is_null($this->getOrder()->getShippingDescription()) ? '' : strip_tags($this->getOrder()->getShippingDescription()),
               'code' => $this->getOrder()->getShippingMethod()
           ]
       ];
   }

Currently results in an error:

Order.CRITICAL: Exception: Deprecated Functionality: strip_tags(): Passing null to parameter #1 ($string) of type string is deprecated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant