Skip to content

Commit

Permalink
Fix for manually set position on external URLs #2470
Browse files Browse the repository at this point in the history
  • Loading branch information
rhukster committed Apr 22, 2019
1 parent 9c0de8b commit b4b8b63
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 15 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
1. [](#bugfix)
* Remove disabled fields from the form schema
* Fix issue when excluding `inlineJs` and `inlineCss` from Assets pipeline [#2468](https://github.com/getgrav/grav/issues/2468)
* Fix for manually set position on external URLs [#2470](https://github.com/getgrav/grav/issues/2470)

# v1.6.6
## 04/17/2019
Expand Down
15 changes: 0 additions & 15 deletions system/src/Grav/Common/Assets.php
Original file line number Diff line number Diff line change
Expand Up @@ -267,21 +267,6 @@ 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) {
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 b4b8b63

Please sign in to comment.