Join GitHub today
Fix ModelChoiceList problem with string key #6150
The ModelChoiceList code was based on EntityChoiceList for doctrine, but a critical misinterpretation happen.
I have a list where one key is : "1SER+"
This crash symfony in ChoiceList addChoice code when the index (1SER+) is not a valid form name.
I modified the code to reflect the way EntityChoiceList does it.
I will also send a pull request in the propel1 project to add the isInteger() function in ColumnMap.
isNumeric() is present, but it cannot be used, because 2.34 contains a dot, and it cannot be used has a form name.
referenced this pull request
Nov 29, 2012
It's my first pull request, so I was monitoring to see if everything was fine.
I saw that the (automated ?) build failed, and I checked why.
The query class used in the test, /Bridge/Propel1/Tests/Fixtures/ItemQuery.php is not correct.
the function getPrimaryKeys() returns an invalid array.
it should not return a string but a ColumnMap class (check in TableMap class and you will see that the primaryKeys private field never contains string, but keyed ColumnMap classes.
I am not currently fluent in how to generate test code, so I cannot help here.