nextcloud / nextcloud/server

[Bug]: json_decode(): Passing null to parameter #1 ($json) of type string is deprecated at lib/private/Comments/Manager.php#95

Open
#46,944 0 comments 0 reactions 1 assignee View on GitHub

@kesselb is already working on this.

Since Aug 1, 2024.

1. to develop 29-feedback bug feature: comments
Dominant language
PHP
Stars
36.9k
Forks
5.2k
Avg merge
2d 3h
Merged PRs (30d)
713

Description

⚠️ This issue respects the following points: ⚠️
Bug description

Found in a log file:

url: /apps/recommendations/api/recommendations 
message: json_decode(): Passing null to parameter #1 ($json) of type string is deprecated at lib/private/Comments/Manager.php#95 
version: 29.0.3.5

https://github.com/nextcloud/server/blob/0d16ba6445d9dd3973c875ad1ffab04e970fbc06/lib/private/Comments/Manager.php#L95

https://github.com/nextcloud/server/blob/c52b7e5ebc6736de2d9991af379e4ed9885aab7b/core/Migrations/Version29000Date20231213104850.php#L40-L46

https://github.com/nextcloud/server/blob/226134a19533bf30aa3d9db30752045386a6741b/lib/private/Comments/Comment.php#L407-L418

I'm confused. The IComment object tries to decode the json when calling getMetaData, but normalizeDatabaseData already decoded it?

Steps to reproduce

No idea, found it in the customer log.

Expected behavior

Column does not allow null, but somehow we call json_decode with null.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.