Skip to content

Commit 4f31448

Browse files
committed
fix including multiple relationships from the same relationship path
1 parent 323dfa0 commit 4f31448

2 files changed

Lines changed: 15 additions & 1 deletion

File tree

src/helpers/RequestParser.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ public function getIncludePaths(array $options=[]) {
144144
$wrapped = [$lastStep => $wrapped];
145145
}
146146

147-
$restructured = array_merge($restructured, $wrapped);
147+
$restructured = array_merge_recursive($restructured, $wrapped);
148148
}
149149

150150
return $restructured;

tests/helpers/RequestParserTest.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,12 +218,26 @@ public function testGetIncludePaths_Reformatted() {
218218
'foo',
219219
'bar',
220220
'baz.baf',
221+
'baz.bat',
222+
'user.ship.wing',
223+
'user.ship.nose.window',
224+
'user.friends',
221225
];
222226
$expected = [
223227
'foo' => [],
224228
'bar' => [],
225229
'baz' => [
226230
'baf' => [],
231+
'bat' => [],
232+
],
233+
'user' => [
234+
'ship' => [
235+
'wing' => [],
236+
'nose' => [
237+
'window' => [],
238+
],
239+
],
240+
'friends' => [],
227241
],
228242
];
229243

0 commit comments

Comments
 (0)