You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think I've found another issue while using ULID generators, but I'm not sure if the problem comes
from this package or from the Uid component itself.
When generating the value to be saved to the database, the code runs:
return$value->toRfc4122();
which will give us a string, e.g. 01734311-cfdb-1e71-a873-91eff2d332ba
The issue occurs when loading the entity from the database in Guikingone\SymfonyUid\Doctrine\Ulid\UlidType::convertToPHPValue
The $value parameters is 01734311-cfdb-1e71-a873-91eff2d332ba, and Ulid::isValid($value) returns false
(it checks first if the length of the string is 26, which it is not when the Ulid is formatted according to RFC 4122).
If we use $ulid->toBase32(); instead of $ulid->toRfc4122() when converting value to the database, everything seems to work fine.
Do you think I should open an issue to the Symfony issue tracker instead ?
The text was updated successfully, but these errors were encountered:
I'm not sure that the bug comes from Symfony, the RFC defines a specific format and as the Ulid::isValid check that the value is not over a specific length, the RFC format is not "valid" against this specification (even if perfectly valid against the RFC one 😄 )
I'm gonna take a look by the end of today to solve this issue 🙂
I think I've found another issue while using ULID generators, but I'm not sure if the problem comes
from this package or from the Uid component itself.
When generating the value to be saved to the database, the code runs:
which will give us a string, e.g.
01734311-cfdb-1e71-a873-91eff2d332ba
The issue occurs when loading the entity from the database in
Guikingone\SymfonyUid\Doctrine\Ulid\UlidType::convertToPHPValue
The
$value
parameters is01734311-cfdb-1e71-a873-91eff2d332ba
, andUlid::isValid($value)
returns false(it checks first if the length of the string is
26
, which it is not when the Ulid is formatted according to RFC 4122).If we use
$ulid->toBase32();
instead of$ulid->toRfc4122()
when converting value to the database, everything seems to work fine.Do you think I should open an issue to the Symfony issue tracker instead ?
The text was updated successfully, but these errors were encountered: