Skip to content

Commit

Permalink
Better fix for #2470
Browse files Browse the repository at this point in the history
  • Loading branch information
rhukster committed Apr 22, 2019
1 parent b4b8b63 commit 31c5809
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions system/src/Grav/Common/Assets.php
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,22 @@ public function registerCollection($collectionName, Array $assets, $overwrite =
protected function filterAssets($assets, $key, $value, $sort = false)
{
$results = array_filter($assets, function($asset) use ($key, $value) {

if ($key === 'position' && $value === 'pipeline') {

$type = $asset->getType();

if ($asset->getRemote() && $this->{$type . '_pipeline_include_externals'} === false && $asset['position'] === 'pipeline' ) {
if ($this->{$type . '_pipeline_before_excludes'}) {
$asset->setPosition('after');
} else {
$asset->setPosition('before');
}
return false;
}

}

if ($asset[$key] === $value) return true;
return false;
});
Expand Down

0 comments on commit 31c5809

Please sign in to comment.