Setono / SyliusGiftCardPlugin

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

Replace deprecated view handler with twig rendering #128

Closed lruozzi9 closed 3 years ago

lruozzi9 commented 3 years ago

HI! As reported in the FOSRestBundle/UPGRADING-3.0.md the method setTemplate has been removed from the View/View class. To resolve the issue this PR will replace the unnecessary fos_rest.view_handler.default service with the twig service.

loevgaard commented 3 years ago

Will this work in Sylius 1.7, 1.8?

lruozzi9 commented 3 years ago

Hi @loevgaard! Well, after some research, I found that Sylius 1.7 use a release subsequent the 2.12 and in Twig v2.12 the class Environment is present. So, I haven't tested it, but I'm pretty sure it should works!

lruozzi9 commented 3 years ago

Apart from the fact that the setTemplate method was deprecated and removed, I think this was the right solution right away. I understand that FOSRestBundle is specific for rendering serialized data for REST API and not for rendering views.

loevgaard commented 3 years ago

Hi, @lruozzi9

Could you rebase this PR and see if it works? The build works on the master branch now

lruozzi9 commented 3 years ago

Ok

codecov[bot] commented 3 years ago

Codecov Report

Merging #128 (d2df61c) into master (6becc19) will increase coverage by 0.10%. The diff coverage is 0.00%.

Impacted file tree graph

@@             Coverage Diff             @@
##             master    #128      +/-   ##
===========================================
+ Coverage      9.51%   9.62%   +0.10%     
  Complexity      360     360              
===========================================
  Files            63      63              
  Lines          1166    1153      -13     
===========================================
  Hits            111     111              
+ Misses         1055    1042      -13     
Impacted Files Coverage Δ
src/Controller/Action/AddGiftCardToOrderAction.php 0.00% <0.00%> (ø)
src/Controller/Action/GiftCardBalanceAction.php 0.00% <0.00%> (ø)
src/Controller/Action/SearchGiftCardAction.php 0.00% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 6becc19...d2df61c. Read the comment docs.

Roshyo commented 3 years ago

This can be closed IMO as it is part of job done in #139