- Issue created by @ryanrobinson_wlu
- 🇨🇦Canada ryanrobinson_wlu
Inspired by the fix in 3344519, I got mine working by changing the NULL values to empty quotes instead. Starting at line 247 of H5PContent:
$metadata = [ 'title' => $this->get('title')->value, 'authors' => json_decode(($this->get('authors')->value) ?? ''), 'source' => $this->get('source')->value, 'yearFrom' => $this->get('year_from')->value, 'yearTo' => $this->get('year_to')->value, 'license' => $this->get('license')->value, 'licenseVersion' => $this->get('license_version')->value, 'licenseExtras' => $this->get('license_extras')->value, 'authorComments' => $this->get('author_comments')->value, 'defaultLanguage' => $this->get('default_language')->value, 'changes' => json_decode(($this->get('changes')->value) ?? ''), ];
Trying to figure out how to put this into a functioning patch.
- Status changed to Needs review
over 1 year ago 7:35pm 12 June 2023 - 🇩🇪Germany ammaletu Bonn, Germany
I think this is a duplicate of https://www.drupal.org/project/h5p/issues/3281812 🐛 json_decode(): Passing null to parameter #1 ($json) of type string is deprecated Needs review .
- 🇨🇦Canada ryanrobinson_wlu
It's the same function deprecation at least. My patch was on different functions than that one's patch, so I can't easily tell if they're both fixing the same problem from a different direction or whether both pieces needed fixed.
- Status changed to Closed: duplicate
about 1 year ago 5:30pm 30 October 2023 - 🇨🇦Canada shaundychko
The fix here is included already in 🐛 json_decode(): Passing null to parameter #1 ($json) of type string is deprecated Needs review
Compare the commit to 2.0.x https://git.drupalcode.org/project/h5p/-/commit/43daa83a9d3a2988730965c4... with the patch in this issue.