webpatser/laravel-uuid

2.2 is breaking on cookies created in 2.0.1

edanisko opened this issue · 2 comments

composer.json had:

"webpatser/laravel-uuid": "^2.0.1",

deployed as usual and composer pulled in versions : * 2.2

Any visitor with a UUID in cookie is breaking.

Symfony\Component\Debug\Exception\FatalErrorException: Exception 'Symfony\Component\Debug\Exception\FatalErrorException' with message 'Method Webpatser\Uuid\Uuid::__toString() must not throw an exception, caught ErrorException: Undefined property: Webpatser\Uuid\Uuid::$string' in /home/forge/payday.live/releases/20170906013516/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:67

Rolled composer back to:
"webpatser/laravel-uuid": "2.0.1",
Fixed my problem.

2.2 should be backward compatible to 2.0.1 yes??

Hi there,

we experienced the same issue when we upgraded to 2.2.
Uuid::generate() returned a long time ago just a string. We used that in old code and did persist it in redis. At some point Uuid::generate() returns the uuid object. Now that old code was persisting an object instead of just a string. Thanks to the __toString() function not a problem. But with change of version the serialization must have changed, so the 2.2 version was not able to access the string property.
tldr;
Refactor code to just persist the string before upgrading to the new version.

Hope that helps, cheers!

hmm.. the code didn't change for that to happen. Maybe something changed in Laravel?

You can also do Uuid::generate()->string; so it will return a string immediately