I've seen this in a few issues now. Let's get this fixed.

Comments

Wim Leers created an issue. See original summary.

wim leers’s picture

Title: JSON API fails on 8.6 since May 17 » JSON API fails on 8.6 (since #2938035)
Related issues: +#2938035: When PATCHing a field is disallowed, no reason is given for *why* this happens

Root cause determined: #2938035: When PATCHing a field is disallowed, no reason is given for *why* this happens changed a string that JSON API is asserting in its test coverage.

wim leers’s picture

Status: Active » Needs review
StatusFileSize
new1.43 KB

Status: Needs review » Needs work

The last submitted patch, 3: 2976053-3.patch, failed testing. View results

wim leers’s picture

Title: JSON API fails on 8.6 (since #2938035) » JSON API fails on 8.6 (since #2938035 + #1252606)
Status: Needs work » Needs review
Related issues: +#1252606: Add crop anchor option to Scale and Crop image effect
StatusFileSize
new1.23 KB
new2.62 KB

#3 has a failure on 8.6 that does not exist on HEAD:

1) Drupal\Tests\jsonapi\Functional\ImageStyleTest::testGetIndividual
The data member was not as expected.
Failed asserting that Array &0 (
    'attributes' => Array &1 (
…
                'data' => Array &5 (
                    'anchor' => 'center-center'
                    'height' => 121
                    'width' => 120
                )
…
) is identical to Array &0 (
    'attributes' => Array &1 (
…
                'data' => Array &5 (
                    'height' => 121
                    'width' => 120
                )
…

As you can see, the anchor key is new. This was added a few days ago in core's image module, in #1252606: Add crop anchor option to Scale and Crop image effect.

Status: Needs review » Needs work

The last submitted patch, 5: 2976053-5.patch, failed testing. View results

wim leers’s picture

Status: Needs work » Needs review
StatusFileSize
new1.06 KB
new2.62 KB

Passed on 8.6, failed on 8.5.

+++ b/tests/src/Functional/ResourceTestBase.php
@@ -1927,6 +1927,9 @@ abstract class ResourceTestBase extends BrowserTestBase {
+    if (floatval(\Drupal::VERSION) < 8.6) {
+      $expected_document['errors'][0]['detail'] = "The current user is not allowed to PATCH the selected field ($id_field_name). The entity ID cannot be changed.";
+    }

… because this also contains the trailing period that <8.6 does not contain. Oops! 😊😅

wim leers’s picture

Assigned: wim leers » Unassigned
Status: Needs review » Reviewed & tested by the community

Green on 8.5 and 8.6!

wim leers’s picture

Status: Reviewed & tested by the community » Fixed

  • Wim Leers committed ed84b8e on 8.x-1.x
    Issue #2976053 by Wim Leers: JSON API fails on 8.6 (since #2938035 + #...
  • Wim Leers committed 49f2e49 on 8.x-2.x
    Issue #2976053 by Wim Leers: JSON API fails on 8.6 (since #2938035 + #...
wim leers’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.