Closed elzody closed 7 months ago
Hello there, Thank you so much for taking the time and effort to create a pull request to our Nextcloud project.
We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process.
Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6
Thank you for contributing to Nextcloud and we hope to hear from you soon!
Overview
I've been having an issue where, after I add a Context and try to re-fetch all Contexts from
/ocs/v2.php/apps/tables/api/2/contexts/
, the response returned by the API is aContext[]
as expected, but the values are allnull
.Example from before fix
```json { "data": [ { "id": null, "name": null, "iconName": null, "description": null, "owner": null, "ownerType": null, "sharing": [], "nodes": [], "pages": [] } ] } ```This issue was preventing me from properly reviewing pull requests, so I decided to look into it. The problem was found in
ContextMapper.php
, where the row IDs were of typestring
, and the context ID variable heldint
s. They were being compared using===
operator which, in addition to value, checks for type equivalence.string
andint
are not of the same type, so the comparison was failing, resulting innull
values.Upon further investigation and with help from @juliushaertl, it is thought that it is due to sqlite storing the id as a
string
by default. The solution here would be to cast the row ID to anint
so that the strict comparison succeeds and to maintain compatibility with sqlite.