Skip to content

Default value for $this->params->get('sass_overrides'#523

Merged
sonvnn merged 1 commit intotemplaza:masterfrom
GHSVS-de:patch-1
Jan 2, 2024
Merged

Default value for $this->params->get('sass_overrides'#523
sonvnn merged 1 commit intotemplaza:masterfrom
GHSVS-de:patch-1

Conversation

@GHSVS-de
Copy link
Copy Markdown
Contributor

With PHP8.2 message json_decode(): Passing null to parameter #1 ($json) of type string is deprecated.

We are using an astroid template where the settings for sass overrides are deactivated in the template style.

Therefore the line

$sass_overrides = $this->params->get('sass_overrides');

produces a deprecated message in the following line because $sass_overrides === null

$sass_overrides = \json_decode($sass_overrides, true);

==> json_decode(): Passing null to parameter #1 ($json) of type string is deprecated.

This PR adds a default value '{}' as fallback when $sass_overrides === null. It doesn't change the functionality of the method because json_decode() now returns an empty array.

With PHP8.2 message `json_decode(): Passing null to parameter #1 ($json) of type string is deprecated`.
@sonvnn sonvnn self-requested a review January 2, 2024 02:21
Copy link
Copy Markdown
Member

@sonvnn sonvnn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for contribute. I approve this request.

@sonvnn sonvnn merged commit 0ec3fa8 into templaza:master Jan 2, 2024
@GHSVS-de GHSVS-de deleted the patch-1 branch January 2, 2024 12:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants