mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
Association not escaping fieldname #5201
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 @michsk on GitHub (Jul 22, 2016).
Originally assigned to: @ostrolucky on GitHub.
Now just loading a
Option, everything is fine. But when callingOption::getRequiredOptions()thegroupfield name is not escaped.@michsk commented on GitHub (Jul 22, 2016):
Tough when changing the annotation to:
i get a SQL error that the field can not be found, tough in the error i see the field is not escaped.
@Deltachaos commented on GitHub (Jul 22, 2016):
@Michal-sk are you able to write a test that reproduces this issue?
@michsk commented on GitHub (Jul 22, 2016):
sure
@Deltachaos commented on GitHub (Jul 22, 2016):
@Michal-sk would be greae if you create a PR that contains this test. A fix could then be build against the test.
@michsk commented on GitHub (Jul 22, 2016):
Ok, maybe you could tell more about the idea / structure behind the tests? I am a bit overwhelmed and not sure where to start when looking in the tests folder. Do i place the test in M:\files\dev\products\kp\doctrine2\tests\Doctrine\Tests\ORM\Functional\Ticket?
@deeky666 commented on GitHub (Jul 22, 2016):
Isn't it responsibility of
QuotingStrategyto deal with that? IMO escaping of join columns has to be done in userland by aQuotingStrategy. We had issues like this a lot before already.@michsk commented on GitHub (Jul 22, 2016):
The group column is not a join column it self. It is just a column in the table. But when calling a association of the option (ManyToMany self-referenceing) the escape quotes are removed from the associations.
And writing this. I did not have this problem with a different Entity which had many Options. So it looks like this has to do with self-referencing?
@michsk commented on GitHub (Jul 22, 2016):
When i just return the association everything is fine:
But when i use matching it does not escape the fields properly.
@michsk commented on GitHub (Jul 25, 2016):
Is there maybe a difference betwee Sqlite and MySQL? When i play around with
ManyToManySelfReferentialAssociationTestand theECommerceProduct, i added agroupproperty and that does seem to be quoted / escaped@ostrolucky commented on GitHub (Aug 7, 2018):
In Doctrine 3.x, everything is quoted by default, which solves this issue