PHP8 - json_decode(): Passing null to parameter #1 ($json) of type string is deprecated

Created on 10 January 2023, almost 2 years ago
Updated 18 August 2023, over 1 year ago

Problem/Motivation

If you have Paragraphs Report installed and enabled, saving a node will cause a json_decode deprecation warning if you are using PHP 8+.

Steps to reproduce

* Install Paragraphs Report module (composer, etc.)
* Enable in /admin/modules
* Save a node

Proposed resolution

Change function call in src/ParagraphsReport.php from Json::decode(val)</decode> to <code>Json::decode(val ?? ''). I've included an attached patch.

Remaining tasks

None

User interface changes

None

API changes

None

Data model changes

None

πŸ› Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States mjchadwick

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024