Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

addInlineJs parameter type mismatch between v1.5.10 and v1.6.0 #2659

Closed
matt-j-m opened this issue Sep 2, 2019 · 0 comments
Closed

addInlineJs parameter type mismatch between v1.5.10 and v1.6.0 #2659

matt-j-m opened this issue Sep 2, 2019 · 0 comments
Assignees

Comments

@matt-j-m
Copy link

matt-j-m commented Sep 2, 2019

In v1.5.10 the following worked:

$assets->addInlineJs($json, null, null, 'application/ld+json');

As of v1.6.10 the above triggered an error expecting the last param as an array, not a string.

array_merge(): Expected parameter 2 to be an array, string given in system/src/Grav/Common/Assets/Traits/LegacyAssetsTrait.php line 54

Have applied following work-around and tested on v1.5.10 and v1.6.14:

$type = array('type' => 'application/ld+json');
if (version_compare(GRAV_VERSION, '1.6.0', '<')) {
    $type = 'application/ld+json';
}
$assets->addInlineJs($sd, null, null, $type);

Possibly related to open issue #1687

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants