Skip to content

Commit

Permalink
Fixed Assets::addInlineJs() parameter type mismatch between v1.5 an…
Browse files Browse the repository at this point in the history
…d v1.6 [#2659]
  • Loading branch information
mahagr committed Jan 29, 2020
1 parent a47e446 commit 18a26b4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
* Fixed `validation: strict` not working in blueprints [#1273](https://github.com/getgrav/grav/issues/1273)
* Fixed `Data::filter()` removing empty fields (such as empty list) by default [#2805](https://github.com/getgrav/grav/issues/2805)
* Fixed fatal error with non-integer page param value [#2803](https://github.com/getgrav/grav/issues/2803)
* Fixed `Assets::addInlineJs()` parameter type mismatch between v1.5 and v1.6 [#2659](https://github.com/getgrav/grav/issues/2659)

# v1.6.19
## 12/04/2019
Expand Down
6 changes: 5 additions & 1 deletion system/src/Grav/Common/Assets/Traits/LegacyAssetsTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,11 @@ protected function unifyLegacyArguments($args, $type = Assets::CSS_TYPE)
// special case to handle old attributes being passed in
if (isset($arguments['attributes'])) {
$old_attributes = $arguments['attributes'];
$arguments = array_merge($arguments, $old_attributes);
if (is_array($old_attributes)) {
$arguments = array_merge($arguments, $old_attributes);
} else {
$arguments['type'] = $old_attributes;
}
}
unset($arguments['attributes']);

Expand Down

0 comments on commit 18a26b4

Please sign in to comment.