Setono / SyliusGiftCardPlugin

Sell gift cards on your Sylius store and let users use them in the checkout process
MIT License
44 stars 39 forks source link

[Bug]: 500 Error while adding gift card product to the cart #256

Open mpysiak opened 8 months ago

mpysiak commented 8 months ago

Plugin version

0.12.x-dev

Sylius version

1.12.11

What happened?

500 Error while adding gift card product to the cart. I've created new product - gift card. When I try to add product to the cart there is an error.

Problem is in Sylius OrderItemController in method resolveAddedOrderItem probably due to OrderItem::equals() method override

Screenshot 2023-11-07 at 07 36 35

Relevant log output

TypeError:
Sylius\Bundle\OrderBundle\Controller\OrderItemController::resolveAddedOrderItem(): Return value must be of type Sylius\Component\Order\Model\OrderItemInterface, bool returned

  at vendor/sylius/sylius/src/Sylius/Bundle/OrderBundle/Controller/OrderItemController.php:251
  at Sylius\Bundle\OrderBundle\Controller\OrderItemController->resolveAddedOrderItem(object(Order), object(OrderItem))
     (vendor/sylius/sylius/src/Sylius/Bundle/OrderBundle/Controller/OrderItemController.php:83)
  at Sylius\Bundle\OrderBundle\Controller\OrderItemController->addAction(object(Request))
cbastienbaron commented 8 months ago

same issue here :

composer info setono/sylius-gift-card-plugin
name     : setono/sylius-gift-card-plugin
descrip. : Gift card plugin for Sylius
keywords : 
versions : * 0.12.x-dev
type     : sylius-plugin
license  : MIT License (MIT) (OSI approved) https://spdx.org/licenses/MIT.html#licenseText
homepage : 
source   : [git] https://github.com/Setono/SyliusGiftCardPlugin.git 044203e0346735aa7979a83b2809be47e75f1269
dist     : [zip] https://api.github.com/repos/Setono/SyliusGiftCardPlugin/zipball/044203e0346735aa7979a83b2809be47e75f1269 044203e0346735aa7979a83b2809be47e75f1269
path     : /warehouse/sylius/master-forks/chateau-de-la-chaize/vendor/setono/sylius-gift-card-plugin
names    : setono/sylius-gift-card-plugin

......
composer info sylius/sylius                 
name     : sylius/sylius
descrip. : E-Commerce platform for PHP, based on Symfony framework.
keywords : 
versions : * v1.12.10

have u got a clue/workaround @mpysiak ?

mpysiak commented 8 months ago

have u got a clue/workaround @mpysiak ?

Sorry, didn't hove time to go into details

marekrzytki commented 4 months ago

Any updates/progress on this issue?

loevgaard commented 2 months ago

I will be working on these issues in the upcoming weeks. The first PR I did today where I dropped support for PHP 7.4 and PHP 8.0 to make it easier for me.