Skip to content
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

fixes duplicate keys in normalizedColumnNameMap #1726

Merged

Conversation

hsegnitz
Copy link
Contributor

The generated code duplicates keys in the normalized column name map array in certain cases where two variants of how to specify a column accidentally create the exact same spelling.

For example the spelling of a single word column name is the same when using camelcase or snake_case. PHP ignorhes this but many tools flag this as a potential error, hence this fix.

Marked draft as I have to figure out the unit tests

Copy link
Contributor

@mringler mringler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @hsgnitz,
this looks good. I like how the method starts to resemble code, instead of ascii-art. If you want to fully convert it, I have added some suggestions below. Though this is already a big improvent.

Let me know if you have questions about setting up the tests.
Best,
Moritz

src/Propel/Generator/Builder/Om/TableMapBuilder.php Outdated Show resolved Hide resolved
src/Propel/Generator/Builder/Om/TableMapBuilder.php Outdated Show resolved Hide resolved
@hsegnitz hsegnitz marked this pull request as ready for review April 28, 2021 19:34
@hsegnitz hsegnitz force-pushed the fix-duplicate-array-keys-in-table-map branch from 2eb1e4b to 663067c Compare April 28, 2021 23:01
@hsegnitz hsegnitz force-pushed the fix-duplicate-array-keys-in-table-map branch from 663067c to aa31134 Compare May 5, 2021 21:42
@hsegnitz
Copy link
Contributor Author

hsegnitz commented May 5, 2021

I rebased it to the current master. Anything else I need to do? Do we need to resolve the discussions?

@dereuromark dereuromark added the Bug label May 5, 2021
@mringler
Copy link
Contributor

mringler commented May 6, 2021

Hey @hsegnitz,
Everything is great, all that's left to do is wait. The maintainers seem to have limited time to spend on this project, so it usually takes a while until you see progress. This can be discouraging, and as a fellow contributer, I should have warned you about it. Sorry!
In my experience, it does not mean they don't appreciate all your work.

I submitted another PR last week, and I think it blew their capacities. Now I am holding back, not to get in the way of a new contributor. I had hoped, that running the tests would have been approved by now, but what can you do, it takes as long as it takes.

Anyway, again, sorry for not mentioning it earlier.

Best,
Moritz

@dereuromark dereuromark merged commit 1e32784 into propelorm:master May 6, 2021
@hsegnitz hsegnitz deleted the fix-duplicate-array-keys-in-table-map branch May 16, 2021 21:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants