-
Notifications
You must be signed in to change notification settings - Fork 143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extensions Are Silently Dropped #183
Comments
Why not store the PhoneNumberFormat::RFC3966 ? This stores the extension as well. Is there data it loses compared to E164? I'm wondering if we could even configure the doctrine type to allow us to pick the DB format? |
@gnat42 Mostly useless overhead of |
Yeah, I've just done the same thing locally. |
I have also discovered this issue. This is on a brand new setup, so BC is not an issue. when you say to use " |
Problem
While working with phone numbers I discovered that phone numbers aren't handled properly when they contain extension. This is related to giggsey/libphonenumber-for-php#255, since
PhoneNumberType
internally callsPhoneNumberUtil::format()
while saving andPhoneNumberUtil::parse()
while reading.Solution
Maybe a better way would be to serialize and unserialize the object instead to prevent loosing data, since
PhoneNumber
intentionally implements\Serializable
. Of course at this point it has to be done as a separate DBAL type to prevent BC issues with old data saved in DB.I can prepare patch if you like, however I'm not sure is that what you want to do.
Workaround
Currently the easiest workaround for the issue while using anemic entities is to use two fields in entity, say
phone
&phoneExt
and makegetPhone()
add extension to the object fromphoneExt()
andsetPhone()
to extract extension to a separate field.The text was updated successfully, but these errors were encountered: