M2 Gift card is not compatible with M2.2.9

Created by Jane D, Modified on Wed, 8 Jan, 2020 at 5:12 PM by Jane D

QUESTION:


When I setup:di:compile, I got the error below:


 PHP Fatal error: Declaration of Bss\GiftCard\Block\Adminhtml\Items\Column\Name\GiftCard::truncateString($value, $length = 80, $etc = '...', &$remainder = '', $breakWords = true) must be compatible with Magento\Sales\Block\Adminhtml\Items\Column\Name::truncateString(string $value, int $length = 80, string $etc = '...', string &$remainder = '', bool $breakWords = true): string in /var/www/html/grandstores/app/code/Bss/GiftCard/Block/Adminhtml/Items/Column/Name/GiftCard.php on line 112


Please tell me how to fix it?


ANSWER:


The issue reported above due to the module M2 Gift Card is not compatible with M2.2.9.


To fix this issue, please edit the file app/code/Bss/GiftCard/Block/Adminhtml/Items/Column/Name/GiftCard.php as below:


Line 97, 98,99,100,101, 102:


From

    $value,

    $length = 80,

    $etc = '...', 

    &$remainder = '',

    $breakWords = true

 ) {


To

    string $value,

    int $length = 80,

    string $etc = '...',

    string &$remainder = '',

    bool $breakWords = true

    ): string {


If you need any further assistance, please feel free to leave us a message via https://bsscommerce.com/contact. We'd be happy to help you out.

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article