mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
Numbers in a string using underscore naming strategy #6325
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @vuras on GitHub (Oct 8, 2019).
Originally assigned to: @lcobucci on GitHub.
Bug Report
Summary
If a string has numbers the naming strategy fails to convert the property name.
Current behavior
base64Encoded converts to base64encoded
How to reproduce
Add a property to entity that has a number in camelcased property name.
Expected behavior
base64Encoded converts to base64_encoded
@Ocramius commented on GitHub (Oct 8, 2019):
Possibly a bug in https://github.com/doctrine/inflector?
@lcobucci commented on GitHub (Oct 8, 2019):
Not really:
a36809db72/lib/Doctrine/ORM/Mapping/UnderscoreNamingStrategy.php (L136-L145)@lcobucci commented on GitHub (Oct 8, 2019):
Seems an easy pick, though
@Ocramius commented on GitHub (Oct 8, 2019):
Was totally convinced it would be using the inflector there :D
@vuras feel free to send a patch (and test) for
UnderscoreNamingStrategy@lcobucci commented on GitHub (Oct 8, 2019):
Sorry, I got the patch already 😬
There's just one problem, though: it affects table names like
DDC1476EntityWithDefaultFieldType(which gets converted toDDC1476_ENTITY_WITH_DEFAULT_FIELD_TYPEinstead ofDDC1476ENTITY_WITH_DEFAULT_FIELD_TYPE).Possible BC break, then, so I'll force it to only work for properties.
@lcobucci commented on GitHub (Oct 8, 2019):
Handled by #7856, thanks for reporting it @vuras!
@vuras commented on GitHub (Oct 8, 2019):
Thank you! When should I expect the 2.6.5 released?
@lcobucci commented on GitHub (Oct 8, 2019):
I'd like to say "really soon" but, realistically speaking, it should take us a few weeks since there're some bugs that should be included IMHO.
@igoel commented on GitHub (Nov 18, 2019):
Even this, is breaking everything, so why do this in a minor version?
@lcobucci commented on GitHub (Nov 18, 2019):
@igoel @cobyl @sGy1980de we overlooked things and this is indeed a BC break. I'll rework it and send a new patch version
2.6.6to address that.I'm sorry for affecting your app and thank you for letting us know of this error.
@lcobucci commented on GitHub (Nov 18, 2019):
@igoel @cobyl @sGy1980de new release made to address the BC break. We apologise, again, for the inconvenience.
@igoel commented on GitHub (Nov 19, 2019):
Thx, for the fast response and action 👍