Open melkamar opened 2 weeks ago
Thanks for really thorough description and investigation! I've put the report into next bugfix milestone, we'll see if we manage to fix it soon
I don't understand the logic of the code well enough
Yeah, this is a total can of worms :) You never know (until you run tests) if the applied fix does not break something else ;)
Bug Report
Summary
For the following query I am getting a duplicated part of the query string:
This seems to happen when there is a mapping along the path of the query with this metadata:
embedded: true
type: many
targetDocument: null
strategy: set
How to reproduce
I have pinned this down to this location in DocumentPersister. In my case, when that code is being executed, I have this context:
$fieldName
isproperties.meetingInfo.properties.date.value
$mapping
has these values:The problem is that when the code linked above is executed:
At the point before
$fieldName .= '.' . $nextObjectProperty;
is executed, the values are:Which causes the returned field name to contain the
.date.value
part twice.The values are set by the condition on line 1276 evaluating to true:
This if-branch does not change the value of
$fieldName
like the other branches do, and thus when a part of the string is then appended to it, it is wrong. If I add the same line as is in the other if-branch below:Then my case starts working as expected.
I don't understand the logic of the code well enough to know what is the correct fix here. It's either
$fieldName = $e[0] . '.' . $e[1] . '.' . $e[2];
to the first if-branch, orfalse
for the$mapping
context I provided above (in which case if-branch on line 1288 gets executed)