Orm: Numbers in a string using underscore naming strategy

Created on 8 Oct 2019  路  12Comments  路  Source: doctrine/orm

Bug Report

| Q | A
|------------ | ------
| BC Break | no
| Version | 2.6.4

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

Bug

Most helpful comment

@igoel @cobyl @sGy1980de new release made to address the BC break. We apologise, again, for the inconvenience.

All 12 comments

Seems an easy pick, though

Was totally convinced it would be using the inflector there :D

@vuras feel free to send a patch (and test) for UnderscoreNamingStrategy

Sorry, I got the patch already :grimacing:

There's just one problem, though: it affects table names like DDC1476EntityWithDefaultFieldType (which gets converted to DDC1476_ENTITY_WITH_DEFAULT_FIELD_TYPE instead of DDC1476ENTITY_WITH_DEFAULT_FIELD_TYPE).

Possible BC break, then, so I'll force it to only work for properties.

Handled by #7856, thanks for reporting it @vuras!

Thank you! When should I expect the 2.6.5 released?

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.

Sorry, I got the patch already

There's just one problem, though: it affects table names like DDC1476EntityWithDefaultFieldType (which gets converted to DDC1476_ENTITY_WITH_DEFAULT_FIELD_TYPE instead of DDC1476ENTITY_WITH_DEFAULT_FIELD_TYPE).

Possible BC break, then, so I'll force it to only work for properties.

Even this, is breaking everything, so why do this in a minor version?

@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.6 to address that.

I'm sorry for affecting your app and thank you for letting us know of this error.

@igoel @cobyl @sGy1980de new release made to address the BC break. We apologise, again, for the inconvenience.

Thx, for the fast response and action :+1:

Was this page helpful?
0 / 5 - 0 ratings