Closed (fixed)
Project:
Gutenberg
Version:
8.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
5 May 2023 at 14:32 UTC
Updated:
26 Sep 2023 at 09:29 UTC
Jump to comment: Most recent
On php 8.1 I get the following error:
Deprecated function: json_decode(): Passing null to parameter #1 ($json) of type string is deprecated in gutenberg_form_node_form_alter() (line 455 of modules/contrib/gutenberg/gutenberg.module).
We should probably check the value of $json variable before passing it to json_decode
To fix this change line 453 from:
$gutenberg_template = json_decode($config->get($node_type . '_template'));
To:
$gutenberg_template_json = $config->get($node_type . '_template');
$gutenberg_template = $gutenberg_template_json ? json_decode($gutenberg_template_json) : null;I may provide a patch later
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
ranjit1032002Comment #4
ranjit1032002Created MR!48 for the issue mentioned, please review.
Thank You.
Comment #5
dineshkumarbollu commentedHi Ranjit1032002
MR!48 looks fine now it doesn't show the error,
moving +RTBC
Thanks.
Comment #6
goldCheers for this @Ranjit1032002,
I have the patch in MR!48 running in 2 environments and the issue is looking to be resolved with that.
+1 for RTBC
Comment #9
szeidler commentedThis got committed to dev. Thanks for your contributions.