Closed (fixed)
Project:
JSON:API
Version:
8.x-2.x-dev
Component:
Code
Priority:
Minor
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
28 Jan 2019 at 14:26 UTC
Updated:
12 Feb 2019 at 15:04 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
wim leers#2955615: Field properties are not being denormalized introduced this:
#2957385: FieldItemNormalizer never calls @DataType-level normalizer service' ::denormalize() method landed yesterday, so we can get rid of that todo! 🎉 Except we can't, because that only landed in 8.7, and JSON:API 2 supports 8.5 + 8.6 + 8.7. So, did that in #3015325-21: [ignore] support issue for the core patch.
Comment #3
wim leersImproved a whole bunch of them.
Comment #4
wim leersCreated a new core issue for one of the
@todos: #3028967: Queries across storages fail with very confusing exception.Comment #5
wim leersBased on re-reading the issue (#2958587: Unable to filter on columns of entity reference fields) that introduced this particular @todo, I think this is actually unnecessary now.
Comment #6
wim leersCreated another core issue: #3028976: Enable an entity query's return value to carry cacheability, for another
@todo.Comment #7
wim leers#2949021: Deprecate schema fallback in ConfigEntityType::getPropertiesToExport landed, so we can update its
@todo.Comment #8
wim leersYay, found the first
@todowhose blocker landed, we just forgot to do it!Comment #9
wim leersActually, lots of occurrences of the pattern in #8! Let's fix them all. These were blocked on #2939810: EntityResource::patchIndividual() should allow fields that the user is not allowed to change, as long as they match the current value, and that issue should've fixed these, but it didn't. 😅
Comment #10
wim leersSimilarly, #2934149: [>=8.5] JSON API routes not specifying _content_type_format route requirement, resulting in bad DX landed, but it only solved the
@todofor thePATCHcase, not the one for thePOSTcase. Fixed.Comment #13
wim leersAgain similarly, #2543726: Make $term->parent behave like any other entity reference field, to fix REST and Migrate support and de-customize its Views integration was fixed, but the
@todowasn't updated. Sadly, that only landed in 8.6, and since JSON:API still supports 8.5, we'll just need to make it run conditionally now. Still, that's a step forward :)Also, the above patches didn't apply because I still had #3015325: [ignore] support issue for the core patch applied while creating these patches. Sorry about that.
Comment #14
wim leersAgain similarly, #2956084: Impossible to raise an error when an `include` is requested for an inaccessible relationship field. was fixed, but its
@todohadn't been removed.Comment #16
wim leersA few trivial fixes and one CS fix.
Comment #18
wim leersAnother one, this time for #2929428: [>=8.5] Convert "throw new *HttpException" into "throw new Cacheable*HttpException" where possible.
Comment #20
wim leersProgress. Still fails though, now on expected cache contexts instead of cache tags.
Note that unlike #18, this is now also asserting the body!
Comment #21
wim leersDealing with the cache contexts here is A) out-of-scope, B) blocked on other issues. Enabling the majority of that test coverage still is a big step forward.
Comment #23
wim leersWhile working on #21, I think I observed a lengthy override to be unnecessary. Let's see.
Comment #24
wim leersSigning off for today. @gabesullice, feel free to continue in the mean time. I haven't yet figured out where the Drupal 8.5 failure was introduced.
Comment #25
gabesulliceyoink!
Comment #26
gabesullice#2938035: When PATCHing a field is disallowed, no reason is given for *why* this happens added a period to the end of the error message: "The current user is not allowed to PATCH the selected field (uid). The entity ID cannot be changed", which only applies to 8.6 and above.
This will need to be undone in #3015325: [ignore] support issue for the core patch
Comment #27
gabesullice#13 introduced a version test, but I think it mistakenly had the comparison operator flipped.
Comment #28
gabesulliceComment #29
wim leersThanks Gabe! Picking this up again :)
Comment #30
wim leersI queued PHP 5.6/Drupal 8.5 tests for all patches, since that's failing in #25. Turns out it's also failing on HEAD: https://www.drupal.org/pift-ci-job/1184958. So … that's not introduced here. Still, here's an attempt to fix that.
Comment #31
wim leers#2939810: EntityResource::patchIndividual() should allow fields that the user is not allowed to change, as long as they match the current value was also fixed without two
@todos getting resolved. Fixed.Comment #32
wim leersAdding all mentioned issues as related issues.
Comment #33
wim leersIn a few cases, the patch was able to address the
@todobut had to introduce a more narrowly scoped new one that is blocked on something more specific. Adding those as related issues too.Comment #35
wim leersFix CS violation.
Comment #36
wim leersApparently the
Commententity's validation order changed in Drupal 8.7. Working around that.Comment #37
wim leers#18 was incomplete, there was one more
@todofor #2929428: [>=8.5] Convert "throw new *HttpException" into "throw new Cacheable*HttpException" where possible.Comment #39
wim leersComment #41
wim leersComment #43
wim leers#41 was insufficient to prevent multiple identical fieldsets from being tested, any non-first request would result in a cache hit of course.
Comment #44
wim leersAnd there were some quite obvious simplifications that I refrained from doing earlier: explicit asserts that are part of the now uncommented
assertResourceResponse(…)call 👍Comment #45
wim leers@todos in.phpfilesAfter patch: 128
@todos in.phpfiles@todos refer to #2300677: JSON:API POST/PATCH support for fully validatable config entities (~80). Many@todos are about 8.5/8.6 work-arounds, that are removed in #3015325: [ignore] support issue for the core patch (that currently removes 21@todos).@todothat I would have to address here otherwise in a less-than-ideal way.@todos of which ~80 are about config entities, ~5 are about PHP 5.x limitations, and the remainder are mostly long-standing core bugs. I thinkConclusion: this patch is a big leap forward:
14 files changed, 109 insertions, 313 deletions. Green on Drupal 8.5+8.6+8.7 and PHP 5+7. Let's do this! 🚢Comment #47
wim leersComment #48
gabesullice👏👏👏 nice!