Propel2
Propel2 copied to clipboard
addJoin table names without alias get mangled
Found an issue in ActiveQuery/Criteria.php, method addJoin.
The left and right column names get stripped of the first character if there is no "." in the provided values.
I have corrected this (in my local copy of the most recent release) with the following:
line 921:
$leftColumnName = substr($left, $dotpos ? $dotpos + 1 : 0);
line 927:
$rightColumnName = substr($right, $dotpos ? $dotpos + 1 : 0);
These check for the presence of $dotpos, which is false if there is no "." in the left or right values.
The current code automatically adds 1 to $dotpos, making it 1 if there is no ".", and winds up stripping the first character off of the left and right values, causing the subsequent query to fail.
Would you like to send us a PR with that changes?
Sure. How would I go about doing that?
Fork this repo, add the change, make sure test suite is green, preferably add a custom test which proofs your changes (means: the test should fail without your code change), commit the changed, push to your fork, and then come backto this repository and create a pull request.
ping @donCarlosOne
@dereuromark I haven't used Propel in quite some time, so really have nothing to add at this time.
@Incognito Do we want to follow up on this?
Sounds like something that would be great to have a fix for.
Low severity as there is a work-around, high value because it is something that should just work out of the box. The fix suggested makes perfect sense, I don't know what the setup would need to look like to have no ".
" however.