Skip to content

Commit

Permalink
fix: overloaded property error
Browse files Browse the repository at this point in the history
  • Loading branch information
pmccarren committed Jan 21, 2020
1 parent d2a1b34 commit ba7cbdf
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions src/Architect.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,19 +92,14 @@ private function parseResource(array $modes, &$resource, &$root, $fullPropertyPa

$object = &$resource[$property];
} else {
if ($resource->{$property} === null) {
if (!is_object($resource)) {
continue;
}

// if we failed to load the relation and the resource is a
// string (the id), we can't do anything, so return
// FIXME: Find root cause of error "Indirect modification of overloaded property"
// (Note: encountered with relations 3 levels deep, with same model relating to multiple)
if ($mode === 'sideload' && getType($resource->{$property}) === 'string') {
return;
$object = $resource->{$property};
if (!is_object($object)) {
continue;
}

$object = &$resource->{$property};
}

if (empty($steps)) {
Expand Down

0 comments on commit ba7cbdf

Please sign in to comment.