Setono / SyliusGiftCardPlugin

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

0.11.7 Incompatible with friendsofsymfony/rest-bundle ^3.0 #197

Closed seizan8 closed 2 years ago

seizan8 commented 2 years ago

Using the 0.11.7 version of SyliusGiftCardPlugin.

It requires friendsofsymfony/rest-bundle: "^2.8 || ^3.0".

However FOS\RestBundle\View\View does not have a setTemplate method anymore since 3.0 When I open my cart summary in the frontend, I get this: Attempted to call an undefined method named "setTemplate" of class "FOS\RestBundle\View\View". in vendor/setono/sylius-gift-card-plugin/src/Controller/Action/AddGiftCardToOrderAction.php (line 80)

Requiring "^2.8" does not work as 2.8 does not support PHP 8.

I don't have much experience with the REST bundle. Why is it needed? Couldn't the Action simply extend symfony's AbstractController and use $this->render($template, $context); like every normal Action?

loevgaard commented 2 years ago

Hi @seizan8

Wdyt about this PR: https://github.com/Setono/SyliusGiftCardPlugin/pull/199? :) I reckon it should fix this whole compatibility problem

loevgaard commented 2 years ago

I have merged it into 0.11. Could you try and test it out before we release 0.11.8?

seizan8 commented 2 years ago

@loevgaard yeah sure. How do I do this though? Like, It seems I am not able to require that specific branch.

loevgaard commented 2 years ago

Instead of ^0.11 you will replace that with 0.11.x-dev in your composer.json and then run composer update setono/sylius-gift-card-plugin. I suppose 0.11.x@dev would also work

seizan8 commented 2 years ago

Oh alright. I forgot the "-dev", thx.

I did not get an error this time! However, the button does not work. I'll look more into it tomorrow as something came up. I assume it's an error on my end, not having the Plugin integrated correctly most likely.

loevgaard commented 2 years ago

Sounds great, @seizan8 :)

seizan8 commented 2 years ago

Aaaaalright. I got it working. I had some issue with the sylius bootstrap theme.

This looks good! The issue I had has been resolved. Thanks a lot :)

loevgaard commented 2 years ago

Will make a release now then. Thank you for testing :)