You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The problem is that when the code linked above is executed:
// No further processing for fields without a targetDocument mappingif (! isset($mapping['targetDocument'])) {
if ($nextObjectProperty) {
$fieldName .= '.' . $nextObjectProperty; // ---> This is where the suffix gets duplicated and causes problems
}
return [[$fieldName, $value]];
}
At the point before $fieldName .= '.' . $nextObjectProperty; is executed, the values are:
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:
$fieldName = $e[0] . '.' . $e[1] . '.' . $e[2];
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
Adding the $fieldName = $e[0] . '.' . $e[1] . '.' . $e[2]; to the first if-branch, or
Changing the condition so that it evaluates to false for the $mapping context I provided above (in which case if-branch on line 1288 gets executed)
The text was updated successfully, but these errors were encountered:
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)The text was updated successfully, but these errors were encountered: