Skip to content

Commit

Permalink
Fix array diffing
Browse files Browse the repository at this point in the history
  • Loading branch information
ADmad authored Jun 6, 2024
1 parent b6f1885 commit fe50b47
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/Listener/ViewListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -239,12 +239,9 @@ protected function _getRelatedModels(array $associationTypes = []): array
}
}

$models = Hash::normalize($models, default: []);

$blacklist = $this->_action()->getConfig('scaffold.relations_blacklist');
if (!empty($blacklist)) {
$blacklist = Hash::normalize($blacklist);
$models = array_diff_key($models, array_flip($blacklist));
$models = array_diff($models, $blacklist);
}

return $models;
Expand Down

0 comments on commit fe50b47

Please sign in to comment.