For JSON:API to go into Drupal core, certain BC layers need to be dropped: see #2843147: Add JSON:API to core as a stable module. This issue can contain the patch that does that, so we can first get a green test run just for JSON:API, before uploading a core patch.

CommentFileSizeAuthor
#53 3015325-53.patch72.64 KBWim Leers
#53 interdiff.txt2.7 KBWim Leers
#52 3015325-52.patch70 KBWim Leers
#49 interdiff-49.txt7.15 KBamateescu
#48 3015325-48.patch68.34 KBWim Leers
#48 interdiff.txt1.02 KBWim Leers
#47 rest-module-3015325-47.patch1.76 KBWim Leers
#46 3015325-46.patch67.7 KBWim Leers
#46 interdiff.txt997 bytesWim Leers
#44 3015325-44.patch67.09 KBWim Leers
#43 3015325-43.patch67 KBWim Leers
#43 interdiff.txt969 bytesWim Leers
#42 3015325-42.patch67.61 KBWim Leers
#42 interdiff.txt4.73 KBWim Leers
#41 3015325-41.patch71.42 KBWim Leers
#39 3015325-39.patch70.52 KBWim Leers
#37 3015325-37.patch69.46 KBWim Leers
#37 interdiff.txt7.04 KBWim Leers
#36 3015325-36.patch62.8 KBWim Leers
#36 interdiff.txt1.69 KBWim Leers
#33 interdiff.txt12.32 KBWim Leers
#32 3015325-32.patch66.45 KBWim Leers
#31 3015325-31.patch54.1 KBWim Leers
#31 interdiff.txt4.13 KBWim Leers
#28 3015325-28.patch51.43 KBWim Leers
#28 interdiff.txt1.68 KBWim Leers
#26 3015325-26.patch50.54 KBWim Leers
#26 interdiff.txt605 bytesWim Leers
#23 3015325-23.patch50.5 KBWim Leers
#23 interdiff.txt3.85 KBWim Leers
#22 3015325-22.patch45.47 KBWim Leers
#21 3015325-21.patch45.54 KBWim Leers
#21 interdiff.txt1.36 KBWim Leers
#20 3015325-20.patch44.29 KBWim Leers
#20 interdiff.txt5.82 KBWim Leers
#18 3015325-18.patch39.14 KBgabesullice
#18 interdiff.txt833 bytesgabesullice
#17 3015325-17.patch39.3 KBgabesullice
#17 interdiff.txt854 bytesgabesullice
#16 3015325-16.patch39.74 KBgabesullice
#16 interdiff-13-16.txt9.17 KBgabesullice
#14 3015325-14.patch62.57 KBgabesullice
#14 interdiff.txt32 KBgabesullice
#13 3015325-13.patch32.37 KBWim Leers
#12 3015325-12.patch32.39 KBWim Leers
#12 interdiff.txt848 bytesWim Leers
#11 3015325-11.patch31.62 KBWim Leers
#11 interdiff.txt6.19 KBWim Leers
#8 3015325-8.patch25.91 KBWim Leers
#8 interdiff.txt1.05 KBWim Leers
#7 3015325-7.patch25.26 KBWim Leers
#7 interdiff.txt6.57 KBWim Leers
#4 3015325-4.patch19.52 KBWim Leers
#4 interdiff.txt803 bytesWim Leers
#2 3015325-2.patch18.78 KBWim Leers
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Wim Leers created an issue. See original summary.

Wim Leers’s picture

Status: Active » Needs review
FileSize
18.78 KB

If this goes into Drupal 8.7 core, there's no need for 8.5 and 8.6 compatibility of course. This addresses most of that.

Wim Leers’s picture

#2 removed all mentions of 8.5, 8.6 or 8.7. Except for three. Those in:

  1. \Drupal\jsonapi\ForwardCompatibility\Normalizer\DateTimeIso8601Normalizer
  2. \Drupal\jsonapi\ForwardCompatibility\Normalizer\DateTimeNormalizer
  3. \Drupal\jsonapi\ForwardCompatibility\Normalizer\TimestampNormalizer

Because we had been assuming since June that #2926508: Add DateTimeNormalizer+TimestampNormalizer, deprecate TimestampItemNormalizer: @DataType-level normalizers are reusable by JSON:API would surely go into Drupal 8.6, and definitely in 8.7. It still hasn't landed 😱 😞 So for now, we need to keep those 3 classes. That means we should start pushing #2926508 forward again, it risks blocking JSON:API.

Wim Leers’s picture

Wim Leers’s picture

Status: Needs review » Postponed
Wim Leers’s picture

Wim Leers’s picture

Wim Leers’s picture

Fix CS violations.

gabesullice’s picture

This core compatibility issue will land soon: #3021277-14: Test failures on 8.7 since #2869426. When it does, we should remove the interdiff in #14 (linked right there 👆)

Wim Leers’s picture

Thanks for being so diligent 👌

Wim Leers’s picture

#3021277: Test failures on 8.7 since #2869426 landed, RC4 is out, time for an updated core patch, and hence time for addressing #9.

Wim Leers’s picture

Wim Leers’s picture

gabesullice’s picture

This removes schema validation and our dependencies on the Schemata module and the justinrainbow/json-schema library. See the failures here: #2843147-103: Add JSON:API to core as a stable module

I'm working on fixing the Postgres issue now.

gabesullice’s picture

gabesullice’s picture

Spoke with @Wim Leers, we decided keeping the json-schema library would be beneficial, which means we're just removing schemata. Interdiff is against #13.

gabesullice’s picture

+++ b/src/EventSubscriber/ResourceResponseValidator.php
@@ -112,31 +98,6 @@ class ResourceResponseValidator implements EventSubscriberInterface {
-  /**
-   * Validates JSON:API responses.
-   *
-   * @param \Symfony\Component\HttpKernel\Event\FilterResponseEvent $event
-   *   The event to process.
-   */
-  public function onResponse(FilterResponseEvent $event) {
-    $response = $event->getResponse();
-    if (!$response instanceof ResourceResponse) {
-      return;
-    }
-
-    $this->doValidateResponse($response, $event->getRequest());
-  }
-

I didn't mean to delete this.

effulgentsia’s picture

JsonapiServiceProvider registers the 'application/octet-stream' mime-type. Since 8.7's FileServiceProvider does that, can this patch be updated to remove it from JsonapiServiceProvider?

Wim Leers’s picture

Wim Leers’s picture

#2955615: Field properties are not being denormalized introduced this:

    // @todo Make this unconditional once https://www.drupal.org/project/drupal/issues/2957385 lands — JSON:API fixed denormalization of properties in https://www.drupal.org/project/jsonapi/issues/2955615, core's Serialization module still has to follow
    if ($test_module === 'jsonapi_test_field_type') {
      $this->assertSame(static::VALUE_ORIGINAL, $denormalized_entity->field_test->value);
    }

#2957385: FieldItemNormalizer never calls @DataType-level normalizer service' ::denormalize() method landed yesterday, so we can get rid of that todo! 🎉

Wim Leers’s picture

Wim Leers’s picture

Removed a few things that those two issues introduced/changed.

And also fixed one thing that should have been removed together with #20.

Wim Leers’s picture

D'oh, lol, I queued a 8.6 and 8.5 test for #23. 🤡 Force of habit. I'll queue all possible envs for 8.7 instead :)

effulgentsia’s picture

#19 hasn't been fully addressed yet. Even after applying #23, JsonapiServiceProvider::alter() registers 'application/octet-stream', which duplicates \Drupal\file\FileServiceProvider.

And while you're in there: #3029626: Use ::class constant instead of string literal where possible.

Wim Leers’s picture

Wim Leers’s picture

effulgentsia’s picture

Status: Postponed » Needs work
effulgentsia’s picture

Wim Leers’s picture

Wim Leers’s picture

FileSize
12.32 KB

Forgot #32's interdiff.

effulgentsia’s picture

Per #2843147-133: Add JSON:API to core as a stable module, let's add a MAINTAINERS.txt entry to this patch.

Wim Leers’s picture

Sure, but that can't happen here, it'll have to happen in #2843147's script, since MAINTAINERS.txt lives in core, not the jsonapi module. Will do!

Wim Leers’s picture

Rebased. Two additional 8.7-specific hunks were added since #32, which this needs to remove. A few hunks are no longer necessary thanks to the recent core security release backporting certain changes from to 8.5/8.6, which hence already removed some core-minor-conditional logic, leaving less work for this patch.

Wim Leers’s picture

The PHP 7 test failed randomly:

1) Drupal\Tests\jsonapi\Functional\EntryPointTest::testEntryPoint
mkdir(): File exists

And the PHP 5 tests are also failing for very surprising reasons:

PHPUnit_Framework_Exception: Argument #2 (No Value) of PHPUnit_Framework_Assert::assertCount() must be a countable or traversable

Retesting both.

Wim Leers’s picture

Wim Leers’s picture

Root cause for the PHP 5 failures found. Fixed in #3035676: Follow-up for #3033123: PHP 5.5 + Drupal 8.7 test runs are suddenly failing. Retesting #39 on PHP 5.

Wim Leers’s picture

Wim Leers’s picture

Updated to take #2940383-60: Unify file upload logic of REST and JSON:API into account: #2940383 won't happen until after JSON:API lands in core, and hence some the changes in #37 that were designed to make the JSON:API core patch be as ready to use #2940383 after it landed can be removed.

Wim Leers’s picture

Wim Leers’s picture

Rebased #43 on ef520336bd13a0f6ce2b8e714cb1b46a98c849dd.

Wim Leers’s picture

Gaaahhhh #3000057: Deprecate drupal_set_time_limit() and file_upload_max_size() and move to Environment component just landed. 😞 Will need to fix those deprecation errors first.

Wim Leers’s picture

Wim Leers’s picture

Wim Leers’s picture

Rebased. And one new 8.5-specific thing that needs to be removed for the core patch, due to newly added test coverage.

amateescu’s picture

FileSize
7.15 KB

This should fix all the recent failures related to taxonomy terms and custom menu links being converted to revisionable.

I'm not sure what's the process for generating a patch here, so I'm attaching just an interdiff that applies on top the patch from #2843147-163: Add JSON:API to core as a stable module.

Wim Leers’s picture

#49: THANK YOU! 🙏Ported that to the contrib module, resolved conflicts, and made it pass on 8.5 and 8.6 too, not just Drupal 8.7. Credited you, of course. See #3015325-8: [ignore] support issue for the core patch and #3015325-10: [ignore] support issue for the core patch.

Wim Leers’s picture

Wim Leers’s picture

Rebased.

Wim Leers’s picture

Most of the necessary new changes already were fixed in the conflict resolutions of #52. This is the only new core-minor-conditional code that was added since b175c3a9fd5cebcb7849de7559f56a73f756d8bc.

Wim Leers’s picture

Assigned: Wim Leers » Unassigned
Status: Postponed » Closed (outdated)

#2843147: Add JSON:API to core as a stable module got committed to 8.8, and will be cherry-picked to 8.7 later today 🥳