- Issue created by @_tarik_
- Merge request !4484Issue #3377269: Warning: Undefined array key "id" in Drupal\jsonapi\Controller\EntityResource->patchIndividual() β (Closed) created by _tarik_
10:01 5:01 Running- Status changed to Needs review
over 1 year ago 9:47pm 26 July 2023 - Issue was unassigned.
- Status changed to Needs work
over 1 year ago 2:16pm 27 July 2023 - πΊπΈUnited States smustgrave
MR should be updated for 11.x
Also will need to research why that value is not set. Could be masking a larger issue.
- last update
over 1 year ago 30,341 pass - π³π±Netherlands bbrala Netherlands
Thanks for the contribution, i'd prefer we use 'isset' instead of empty since empty has a few issues.
- πΊπ¦Ukraine _tarik_ Lutsk
Hi smustgrave (#4)
This problem can be reproduced only if the id attribute wasn't added to the request body. So we can be calm about the module functionality. - πΊπ¦Ukraine _tarik_ Lutsk
Hi bbrala (#5)
Sure I can do this, but could you a bit clarify what issues we can get with using empty() in this part of the code?
I used it because, in this way, we will skip all cases when data['id'] contains an empty string or any other value that can't be for the uuid
Thanks! If you use isset then you know the key exists. Although array_key_exists is technically even cleaner, isset is fine. After that the code would check if the value is an uuid. Does that make sense?
- π³π±Netherlands bbrala Netherlands
If you use isset then you know the key exists. Although array_key_exists is technically even cleaner, isset is fine. After that the code would check if the value is an uuid. Does that make sense?
- last update
over 1 year ago 30,341 pass - Merge request !4531Issue #3377269: Warning: Undefined array key "id" in Drupal\jsonapi\Controller\EntityResource->patchIndividual() β (Closed) created by _tarik_
- last update
over 1 year ago 29,934 pass, 2 fail - πΊπ¦Ukraine _tarik_ Lutsk
bbrala
Thanks for your response!
I got your point and updated the pull request now it uses !isset() instead empty().
Also was created a new branch for the 11.x version of Drupal core. - Status changed to Needs review
over 1 year ago 9:46pm 2 August 2023 - Status changed to Needs work
over 1 year ago 10:14pm 2 August 2023 - πΊπΈUnited States smustgrave
Still needs a test
This problem can be reproduced only if the id attribute wasn't added to the request body. So we can be calm about the module functionality.
How is this reproducible from core? This may be a bug in core that putting isset() is covering up.
- First commit to issue fork.
- Status changed to Needs review
about 1 year ago 2:44pm 3 November 2023 Added test for the mentioned issue.
Also, there was the same issue just under a few lines that I fixed as well.
I am uploading the test-only patch as well.This may be a bug in core that putting isset() is covering up.
@smustgrave There is nothing above,
Drupal\jsonapi\Controller\EntityResource->patchIndividual()
it is Controller. Also, JSON:API correctly responds to the request without the "id" key in the body. The only issue is PHP warnings.- last update
about 1 year ago 30,351 pass, 26 fail - πΈπ°Slovakia poker10
@ReINFaTe No need to upload a separate test only patch or created a new branch if tests are included in the bugfix patch. We can run a test-only Gitlab pipeline now, which will automatically run the tests from the MR, see: https://www.drupal.org/about/core/blog/drupal-cores-gitlab-ci-testing-is... β (Test-only runs are now automated in GitLab CI).
- Status changed to RTBC
about 1 year ago 2:25pm 8 November 2023 - last update
about 1 year ago 30,510 pass - πΊπΈUnited States smustgrave
The tests-only patch does show the issue, so this may be good to go. Lets see.
- last update
about 1 year ago 30,516 pass - last update
about 1 year ago 30,519 pass - last update
about 1 year ago 30,530 pass - last update
about 1 year ago 30,560 pass - last update
about 1 year ago 30,602 pass - last update
about 1 year ago 30,604 pass - last update
about 1 year ago 30,605 pass - last update
about 1 year ago 30,668 pass - last update
about 1 year ago 30,675 pass - last update
about 1 year ago 30,684 pass - last update
about 1 year ago 30,686 pass 17:21 12:32 Running- π³πΏNew Zealand quietone
I read the IS and comments. I did not find any unanswered questions.
- last update
about 1 year ago 30,688 pass - last update
about 1 year ago 30,696 pass - last update
about 1 year ago 30,698 pass - last update
about 1 year ago 30,702 pass - last update
about 1 year ago 30,712 pass - last update
about 1 year ago 30,764 pass - last update
about 1 year ago 30,766 pass - last update
about 1 year ago 25,923 pass, 1,814 fail - last update
about 1 year ago 25,905 pass, 1,813 fail - last update
12 months ago 25,941 pass, 1,825 fail - last update
12 months ago 25,923 pass, 1,808 fail - last update
12 months ago 25,928 pass, 1,806 fail - last update
12 months ago 25,928 pass, 1,831 fail - last update
12 months ago 25,915 pass, 1,835 fail - last update
12 months ago 25,904 pass, 1,842 fail - last update
12 months ago 25,980 pass, 1,835 fail - last update
12 months ago 25,943 pass, 1,834 fail - last update
12 months ago 26,000 pass, 1,823 fail - Status changed to Needs review
11 months ago 11:40am 4 February 2024 - Status changed to RTBC
11 months ago 4:09pm 6 February 2024 - πΊπΈUnited States smustgrave
Appears the question was answered, doesn't appear a change is required.
-
longwave β
committed bb6903e8 on 10.2.x
Issue #3377269 by _tarik_, ReINFaTe, smustgrave, bbrala: Warning:...
-
longwave β
committed bb6903e8 on 10.2.x
-
longwave β
committed b930619b on 11.x
Issue #3377269 by _tarik_, ReINFaTe, smustgrave, bbrala: Warning:...
-
longwave β
committed b930619b on 11.x
- π¬π§United Kingdom longwave UK
Thanks for answering my question.
This is eligible for backport to 10.2.x as a bug fix.
Committed and pushed b930619b05 to 11.x and bb6903e8e6 to 10.2.x. Thanks!
- Status changed to Fixed
11 months ago 2:42pm 7 February 2024 Automatically closed - issue fixed for 2 weeks with no activity.