0
votes

In http://localhost:8000/checkout/shipping I got an error

CRITICAL - Uncaught PHP Exception Symfony\Component\Form\Exception\UnexpectedTypeException: "Expected argument of type "Sylius\Component\Core\Model\ShippingMethod", "string" given" at /home/krzysztof/Dokumenty/praca/smartbyte/sylius/src/Sylius/Bundle/ResourceBundle/Form/DataTransformer/ObjectToIdentifierTransformer.php line 58

and the $value of transform method is an empty string.

It's strange because I got this error only on my project version, and on contribute version everything is ok, despite the version of sylius is in both the same (latest commit). Moreover I don't overwrite ShippingMethod so I don't now why this strange behaviour happens.

1

1 Answers

1
votes

Today, I found the same error. But just days ago everything worked. I often update the project from the git (master branch) and by composer. Therefore I started to look for errors in the last commit. After half a day with the debugger I found no critical changes in the last Sylius commits.

I drew attention to the version of Symfony. It's: 2.8.3. I rolled up to 2.8.0 and the problem has been resolved. I did not understand what was the cause of the error. But the fact remains - selection the delivery method form of Sylius with Symfony v2.8.3 is not working.

I hope this helps.