Updated in #95
Problem/Motivation
Let's say I have computed field with the string value which shows the current time of the request. Right now there is no way to set cachebality metadata for computed fields so jsonapi shows the time of serialization instead of current time in the response.
Proposed resolution
Proposal 1
Allow computed field item list class to provide cacheable metadata. Using CacheableDependencyTrait. See JsonApiComputedFieldItemList in #37.
Proposal 2
Allow PrimitiveDataNormalizer to set the cacheable metadata. Using RefinableCacheableDependencyTrait and PrimitiveDataNormalizer should bubble it. See the patch in #75
Remaining tasks
- Implemented purposal #2.
- Review
- Commit
- Rejoice
User interface changes
None
API changes
API addition so that computed fields/properties based on PrimitiveData can bubble the cacheable metadata.
Data model changes
PrimitiveDataNormalizer can bubble cacheability metadata.
| Comment | File | Size | Author |
|---|---|---|---|
| #130 | interdiff-2997123-122-130.txt | 709 bytes | bbrala |
| #130 | 2997123-130.patch | 19.77 KB | bbrala |
| #123 | interdiff-121-123.txt | 634 bytes | bbrala |
| #123 | 2997123-123.patch | 19.89 KB | bbrala |
| #121 | interdiff-119-121.txt | 2.26 KB | bbrala |
Comments
Comment #2
jibranJust as a sanity check I pinged @amateescu on slack and he agreed that any
*ItemListclass can implementCacheableDependencyInterfaceif needed. So here is the patch.Comment #3
gabesulliceThanks @jibran!
This will need to land against the 2.x branch. Let's see if it applies.
Comment #4
gabesulliceComment #5
jibranHere you go.
Comment #6
e0ipsoThanks for the patch @jibran!
I agree that this will work, but it feels that we are abusing the
$accessvariable to pass down cacheability information. Maybe we can add theRefinableCacheableDependencyTraitin theFieldNormalizerValueso we can generate the value object and then add the cacheable dependency from the field item.An alternative would be to pass additional cacheability information via the
FieldNormalizerValueconstructor.Comment #7
jibranYeah. I agree. I just wanted to show how to solve it. I'll add a new param to the constructor.
Comment #8
jibranI update the constructor and all the calls to the constructor as well.
Comment #9
e0ipsoNice! It seems we were already abusing the
$accessobject in other parts of the codebase.This looks great! Let's hear from the test runner to see a green.
Comment #11
psf_ commentedTo try this patch, where I need implements
CacheableDependencyInterface? In my field type?I'm sorry for the noob question :_ D
Comment #12
gabesulliceInstead of adding an argument, let's just rename
$field_access_resultto$cacheability. IIRC, that argument was only added to capture cacheability in the first place. It has no other use in the constructor.Comment #13
jibranYou have to implement it for the ItemList class.
Addressed #12
Comment #14
gabesullice@jibran, this looks really good! Thank you SO much for all taking this on :)
The only thing this needs now is tests. I think adding one to
JsonApiRegressionTestwould be the easiest place to do that.Comment #15
wim leersLooking good!
Slightly cleaner:
Why are we removing this detailed comment?
Same here.
NW for tests.
Comment #16
jibranThanks, for the review @Wim Leers
Comment #17
jibranAddressed #15. #14 is still pending.
Comment #18
wim leers#16.2: Oh, I get it now! Makes sense :) Also: YAY for less complexity!
Comment #20
gabesulliceThe tests failed because HEAD was broken.
Comment #21
gabesullices/passes/pass
But that can be fixed on commit or when tests are added.
Comment #22
jibranHere is the test module. The actual test is still pending. Interdiff only, no patch.
#21 is still pending.
Comment #23
wim leersCool :) Back to NW for tests!
Comment #24
jibranThanks, to @ylynfatt now we have tests. I'm uploading his work with minor adjustments.
Comment #27
gabesulliceCrediting @ylynfatt. Thanks both of you!
Comment #28
jibranComment #30
axle_foley00 commentedAttempted to fix some of the Codesniffer issues.
Comment #31
gabesulliceThis fixes that last CS violation. Hopefully this will now actually show the test failure, not "Build Successful".
Looking into the test failure now.
Comment #32
wim leersYay, this is the first time that #3000299: Let phpcs violations fail the build on DrupalCI is helping us prevent from committing a patch that has CS violations!
Comment #34
gabesullice@axle_foley00 asked me to help debug this.
Specifically, why we're not getting a cache lifetime of
8000, instead we're gettingUNCACHEABLE.I tried to dig into this, but I did not reach a conclusion. I did a little clean up to make the test failures more informative too.
Perhaps this is already correct, but I'm just not sure.
@Wim Leers would you take a look?
Comment #35
gabesulliceI prefixed these with
_to intentionally fail the tests because I'm not sure that these are the correct values.Comment #37
wim leersBecause #2352009: Bubbling of elements' max-age to the page's headers and the page cache. i.e. a long-existing limitation in Drupal core. Added a
@todofor this.It is :)
This would be simpler if it used
CacheableDependencyTrait:)Needs better comment.
Nit: This can be made more consistent with other regression tests.
Fixed all these nits myself. Patch looks great otherwise, so: RTBC! 🎉
Comment #38
wim leersI was just about to commit this, when I realized something.
Why is this only a problem for computed fields? Why didn't this come up before? Because for example text fields also bubble cacheability: they bubble at least the used text format's cache tag. See
\Drupal\Tests\jsonapi\Functional\CommentTest::getExpectedCacheTags()for example.Well, all those fields have cacheability one level lower: at the property level.
interface FieldItemListInterface extends ListInterface, AccessibleInterfaceis nothing more than a list of things, it's a container. The actual data sits one level lower. And so it's that lower level's cacheability that matters.That level's cacheability is already respected! Look at
\Drupal\jsonapi\Normalizer\Value\FieldNormalizerValue::__construct():IOW: it's
$values(i.e. field properties) whose cacheability is bubbled. This is how it works for all of Drupal core. Sorry for not realizing this sooner.I realize that @jibran wrote:
But actually, nothing in Drupal core does this. Both core REST and JSON API (and probably much other code too) assumes that cacheability for fields lives at the field property level!
Comment #39
wim leersSo: what does your custom computed field look like? Can't the cacheability be moved from the field level to the field property level?
Comment #40
sam152 commentedI agree that cacheable metadata at the
FieldItemorFieldItemListlevel is a smell and doing this would snow-flake jsonapi.IMO no other system expects metadata to be available at this level and I think the reason for that is: cacheability is defined by presentation and those things are natively only concerned with storage. For example, the formatter system couldn't just use
FieldItemcacheability, because the tags are based on the markup rendered by each formatter (ie, an image style formatter will have different config entity tags based on the users configuration).This seems to be a similar ethos driving #2926507: Discourage @FieldType-level normalizers, encourage @DataType-level normalizers, to strengthen the API-First ecosystem.
REST based normalizers are able to respect and use metadata at the
DataTypelevel because those are the primitives that reliably appear embedded in actual resources, the lists and items don't necessarily have a bearing on the presentation of the resource.Comment #41
wim leers@Sam152: Thanks for chiming in, and elaborating on it more! ❤️ 👌
Comment #42
jibranThanks, @Wim Leers for looking into it.
.
One way to avoid this is to write a KerneTest which serialize the test entity and asserts the cacheablity data.
RE: #38, #40
The problem here is that We're creating a string computed field which wants to set the entity cacheablity and given that
\Drupal\Core\TypedData\Plugin\DataType\StringDatadoesn't take cacheablity data. What we are saying here is if a 'string' field has cacheablity data to bubble then we should create a new DataType which should bubble the cacheablity.For rendering it is easier we can accommodate it in the render array returned by the formatters but for normalizing there is no way to accommodate it. IMO core should provide cacheablity for all the DataType plugins and *FieldItem class should have the ability to plugin into that so the formatters and the serializers can bubble the cacheablity data without any issue. Until core provide such system either we have to keep defining new DataTypes e.g.
\Drupal\text\TextProcessed'or fix this issue as a stop-gap solutionComment #43
wim leersCorrect. Because that is the level that actually contains data. Also, there is the case of exposing/processing/interacting/DOING SOMETHING with individual field properties; if cacheability is not carried by EACH property, then it's impossible to do something with each property while respecting cacheability.
IOW: cacheability ought to live at the level where the data lives, otherwise certain use cases are made impossible. Therefore it needs to live at the
@DataTypelevel.Example:
\Drupal\text\TextProcessed.Fixing this issue will not fix it in core REST nor in GraphQL.
Comment #44
wim leersAgain: I'm sorry for not noticing this sooner, and I'm sorry for the annoying inconvenience of asking you to change your code :( But alas Entity/Field/Typed Data API are not perfect. This is is one of those cases where imperfections and lack of clarity leads to wasted time for all involved! 😞
Comment #45
jibranThat is why I said, :)
Comment #46
jibranNo need for this :D. This is not on you this is on me as @Sam152 said we talked about it 2 weeks ago and we agreed on this but as I said this is a stop-gap so I kept pushing it.
$fields['jsonapi_test_computed_field'] = BaseFieldDefinition::create('string_cacheable')Can we please change this test to demonstrate how to add string field which takes cacheablity into account. I lost a day in DataType blackhole, trying to come up with the basefield definition for such a field. Given you worked on
\Drupal\text\TextProcessedyour help here would be really appreciated. It will also become an example for rest of *FieldItem classes.Comment #47
pq commentedI had a requirement for exactly this functionality recently which might serve as an example use case for field-level cacheability.
The requirement was to have a computed (pseudo-)entity reference field on an entity that referenced different content according to data stored against the current user, e.g. a group or region that the user belongs to.
We had already created a cache context that used the concatenated id's of the user's region and group that would ensure correct content for the user with a much higher hit-rate then per-user cacheing.
The challenge was add the cache context to the request if and only if the given field was part of the response. In the end we used an event subscriber which listened for the `kernal.response` event and used some slightly hacky techniques to work out whether the field should be in the response and then add the cache context.
This would have been a lot easier and more robust if we could have simply added the cache metadata at the level of the computed field, and being able to add it at the data type level would not have helped as it is not the referenced entity itself that varies from user to user but the combination of referenced entities which belongs one-level up.
I'd imagine there would probably be a lot of other example of cases where the thing that needs cache metadata is the list of values itself rather than the items that are in the list (if that makes sense).
Comment #48
wim leers+1!
Comment #49
wim leersWanted to work on this right away, but then noticed #37 is still waiting for the branch to pass, because JSON API 2.x HEAD is failing because Drupal core 8.7 changed something. Investigating and fixing at #3001193: CommentTest::testPostIndividualDxWithoutCriticalBaseFields() fails on 8.7 since #2885809.
Comment #50
jibranHad another crack at it. Untested patch.
Comment #52
jibranFeel free to fix the fail. And @Sam152 pointed out IS needs an update.
Comment #53
wim leersFix CS violations.
Comment #55
jibranI think I found the bug now. @Wim Leers can you please have a look at it now. interdiff based on #50.
Comment #56
wim leersActually, on second thought, -1.
That would be adding a test + test class for something that is entirely independent from JSON API; something that belongs in Drupal core. That being said, I'm fine with being pragmatic here :)
This is calling a protected method. That will not work.
EDIT: cross-post :(
Comment #57
jibranFixed the PHPCS issues.
This patch passes with the following change in core:
I promise this is the last patch from me. Over to you.
Comment #58
jibranAfter working on the patch and looking at the latest fail I agree with you, this not a JSON API bug. As I mentioned in #57, to make the test green we need to fix the core. Should we move it to core and demonstrate that this bug exists in serializer?
Comment #60
wim leers#55: I had many of the same changes. Next time please assign the issue to yourself to prevent duplicate effort! 🙏 🙂
What's still missing, is a functional test. And once we have that, IMHO that kernel test can go away. As you just experienced yourself, kernel tests are … tedious and brittle. And in this case, it seems to prove things are working correctly … but what matters is the end result, and for that you need a functional test, and that's proving that it does not work (yet).
The reason this particular computed property doesn't work yet is because it implements
PrimitiveInterface, which causes\Drupal\serialization\Normalizer\PrimitiveDataNormalizerto be used. BecauseCacheableStringData extends StringData extends TypedData implements PrimitiveInterface. Contrast this withTextProcessed extends TypedData. Is this confusing and counter-intuitive? Yes. Much in TypedData is confusing… How did I find out? By writing a functional test that failed and then stepping through it with a debugger.To get the functional test to pass, I also had to switch from the
usercache context to something that will still allow Dynamic Page Cache to cache the result.Attached is the interdiff + patch that add a functional test. The functional test should fail.
Comment #62
wim leersFailed as expected and described in #60: the computed field's property's cache tags and contexts did not bubble to the response!
This implements that fix.
Comment #63
wim leersTime to remove all the out-of-scope changes, now that this issue has been descoped to be about tests only. (See #46 + #48.)
Comment #64
wim leers@PQ: I didn't forget to reply to you! I just wanted to finish this other thing first. I see what you're saying. But:
In the ideal case, you're right. But this will require changes in many places of the Field API and normalizers for fields. There are more important problems to deal with.
You're right that conceptually the cacheability then is associated with the list of things. But really, you can associate that cache context to describe that variation on every item in the list too, that still captures the same thing: "this item varies by context X". It achieves the same end result, with equal accuracy, but with a slightly inferior/less perfect data model.
So I'd ask you to be pragmatic for now and associate the cacheability with each item in the list :)
Comment #65
jibranSorry, about that I got overexcited once I started running test locally.
CacheableStringData extends StringDataIMO, this makes sense. Is there a reason why we are not fixing this upstream inPrimitiveDataNormalizer? We do needPrimitiveInterfacemethods forCacheableStringDataobject so that field api can work properly.Comment #66
wim leersYou're writing comments faster than I can; you're asking the exact questions/rolling the exact patches I was about to, time and time again! 😄 👌 🤜 🤛
#62 and #63 are green! We proved it works!
On the one hand I agree. On the other hand I don't. Because a string with cacheability data is arguably no longer a primitive.
There is some debatability here (see above), but … I agree! And that's where I quote yourself back at you :D From #58:
I agree!
But before doing so, I wanted to have a green patch on this issue to ensure your concerns were addressed.
Moving this issue to Drupal core. Next steps:
PrimitiveNormalizershould also respect cacheability. I think yes. A simple addition of$this->addCacheableDependency($context, $object);should do the trick.ComputedCacheableStringItem(List).\Drupal\Tests\entity_test\Functional\Rest\EntityTestResourceTestBaselike JSON API'sEntityTestTestwas updated.Wanna take that on? :) I can promise fast reviews!
Comment #67
wim leersAnd this of course also serves as a case of documentation, as an example implementation. So tagging for that.
Comment #68
jibran:D on it.
Comment #69
wim leers🎉
Comment #70
tstoecklerComing to this issue from the perspective of cacheability of computed fields in general, i.e. not necessarily in the Rest/API-First context. I.e. #2924384: Add support for cacheable fields, field item lists..
I didn't read through the entire issue, but I noticed that while the issue summary mentions supporting cacheability metadata on the field level, the patch implements it on the typed-data / property level.
I then found #38, which as far as I can tell is the reason for the different approach, but I'd like to argue against it. In particular
While for non-computed fields that is true and, thus, it's good and important that we support cacheability metadata on the property level. This does not hold for computed fields. In particular since the introduction of
ComputedItemListTraitthe logic on how a field value for a computed field is computed lives on the field item list level. And, thus, the field item list solely knows the cacheability metadata for this computation, i.e. under which circumstances the result of the computation may change. So I think it would in fact make sense to support cacheability metadata on the field item list level. Otherwise, computed fields have to implement::computeValue()on the field item list level and then additionally provide overridden typed data classes for any of their properties to declare the cacheability metadata for the result of the computation - possibly for many different properties.I may be missing something, of course, as that is generally the case, but also in particular because I'm coming from a completely different view point, but I'd love to hear your thoughts. Would be also great to get some other Entity / Field API maintainer's thoughts.
Comment #71
jibranHere you go. It is still failing but I can't debug it. :(
EntityResourceTestBaseis huge.RE: #70 FWIW, I agree with you @tstoeckler and before coming up with #37 I did confirm it with @amateescu see #2.
Comment #72
tstoecklerAhh missed that @jibran. Thanks! So looking forward to what @Wim Leers says to this.
Comment #73
wim leersThanks, I didn't know about #2924384: Add support for cacheable fields, field item lists..
I already explained my perspective in #38, #43 and #64. Also see @Sam152's comment at #40.
Comment #74
pq commentedHi @Wim Leers,
Thanks for getting back on this. I totally agree that my example might be an edge case and not the best use of effort at this time.
Will do, thanks.
Comment #75
jibranSeems like I forgot to add the test to the patch.
Comment #76
tstoecklerRe #73: Hmm... I disagree with #40, at least when talking about computed fields for the same reason explained #70. #64 sounds like you tend to agree in principle but don't want to solve that whole issue in the scope of this issue. That's fine with me in general, I just wanted to make sure that we're not setting some kind of precedent here, but seeing that we're pretty much all broadly in agreement (except for #40), I guess that's not the case. So don't mind me...
Comment #78
jibranHere is what I think we should do, not in this issue but as a whole:
#1 will allow us to use the same pattern for all the TypeDatas.
#2 will allow serializers to bubble it form TypeData level.
#3 will allow bubbling TypeData level cacheablity metatadata to render API.
#4 will allow computed field to set their own cacheablity metatadata.
Comment #79
sam152 commentedRe: #70, great points, if decisions are made which impacts things like if an item exists or not or potentially computes to one or multiple deltas, list based cacheability would seem to be an API deficiency that could be addressed, I hadn't considered this at all. The muddy part (and probably the reason for the current state of the api) is lists are varied in their presentation whereas individual properties are pretty much serialized as-is.
For a computed list, with a single item and computed property, cacheability at the list level doesn't really matter, the list itself never really changes. In the examples so far the same field item is always created, if no decisions about the items instantiation are made, a single property being dynamic is better described with cacheability at the data type level imo.
So I totally agree in the former use case list based cacheability would be a hard requirement, but it doesn't seem to me like the tests really illustrate that point. Perhaps it needs something like the "dice roll" example but for the number of items in the list?
Comment #80
jibranUpdated the issue title and IS so that Entity API maintainer can provide the feedback.
Comment #81
jibranHere is a reroll of #37 for jsonapi 2.x branch. Please ignore.
Comment #82
jibranYet another reroll for jsonapi 2.x. Please ignore.
Comment #83
jibranRebased on jsonapi 8.x-2.0-rc2. Please ignore.
Comment #84
dpiRebased on jsonapi ad50c207 (Last stable: 8.x-2.0)
Comment #85
jibranTo reduce the noise on the core issue I created #3026878: [ignore] support issue for the cacheability of normalized computed fields, a testing issue in JSON:API issue queue.
Comment #86
jibranAdded #3028080: Add CacheableNormalization for Normalizer to return Normalized value and Cacheablity to explore proposal 2.
Comment #88
jibranRerolled #84 for core jsonapi.
Comment #89
jibranRerolled the #75 and fixed the fails. This is ready for real review.
Comment #90
wim leers🤔 This can theoretically break some core/contrib tests. Any way we could avoid that?
This is the proof, and this is what should fail in HEAD.
Could you also upload a failing test-only patch?
🤔 This change looks wrong?
Comment #91
jibranThanks, for the review.
\Drupal::is recommanded over$this->containerbut this change is not needed for the patch so reverted.Comment #93
jibranFixed the PHPCS fails.
Comment #94
gabesullice👏 Looks great @jibran, only one typo that I think can be fixed on commit.
I think this is a bug TBH. Updated, the issue metadata.
Nit & typo: "plain string" and
s/cacheablty/cacheabilityon both lines.Can be fixed on commit.
Comment #95
jibranThanks, for the review. Addressed #94.
Comment #96
jibranUpdated IS
Comment #100
acbramley commentedRerolled and fixed the failure by adding $defaultTheme.
Comment #101
jibranThanks, @acbramley for the reroll. Back to RTBC!
Comment #102
alexpottIt's interesting we're not changing the JSONAPI equivalent test. base class.
Do we need to add an equivalent test for JSONAPI in core?
Setting to needs review to get an answer - if the answer is no that's not needed then we can set this back to rtbc.
Comment #103
jibranThanks @alexpott for having a look at it.
This is the only meaningful change here. We have added tests for this to make sure the serialization works and it collects the metadata correctly. I was looking at #2626924: Include processed text in normalizations: "text" field type's "processed" computed property should be non-internal and carry cacheability metadata and I think we need to add a new test in
EntitySerializationTestinstead of JSON:APIComment #104
quietone commentedThanks go to jibran for this patch.
Comment #105
jibranThis is a really good start. Thank you for working on this.
This is to test the cacheable computed field.
We don't need to set a value.
We should pass third param to collect cacheable metadata.
It would be good if we could assert cacheable metadata.
This is not required.
Following patch addresses that feedback.
Comment #106
quietone commentedThanks for the review. After studying it I see that I missed, which I sort of knew anyway but family duties were calling me. Mostly, it confirms that when I am learning something new I really need to take a walk before trying to apply the knowledge.
Comment #107
mglamanGoing to review this today! We need this in the Commerce API as we have computed fields using resolved pricing and a computed field which embeds entities directly, so we need to bubble their cacheability.
Comment #108
mglamanI have some serious concerns if this method actually works, at least with JSON:API.
In the test we do
So I wanted to see where this is set in the normalization and serialization stack.
The REST module adds it to the context when rendering the response body (+1, means it is used throughout)
\Drupal\rest\EventSubscriber\ResourceResponseSubscriber::renderResponseBody
For JSON:API it is only set during the FieldItemNormalizer, not the entire normalization process
\Drupal\jsonapi\Normalizer\FieldItemNormalizer::normalize
It actually creates a new CacheableMetadata for each field item and then unsets it from the context (but manually collects into CacheableNormalization)
So maybe this is OK.
I know HAL is basically unused, but it only does this in \Drupal\hal\LinkManager\LinkManagerBase::getLinkDomain.
Also, I don't see any tests with JSON:API, which is the main use case I would use this in, to make it sure works with the CacheableNormalization paradigm. @alexpott raised this in #102.
Per #103, I still think we need explicit testing since JSON:API uses an extended serialization system.
I'm not comfortable with this patch without explicit JSON:API testing due to its usage of CacheableNormalization objects.
Comment #109
jibranIt is well-argued point, I agree let's add JSON:API specific tests as well.
Comment #111
larowlanrerolls
Comment #113
kim.pepperComment #114
kapilv commentedFixed Custom Commands Failed.
Comment #115
bbralaBit confused on the status here. @jibran in #109 puts in on "needs work" since there is missing tests. Then @larowan in #111 puts it in needs review with only a reroll. Not sure what is correct right now.
Comment #116
bbralaOk, talked about this with larowlan. Should be needs work since tests are still missing.
Comment #117
jb044Perhaps I'm wrong here but we have problems also with cacheability of computed fields that contain an array of values, not a simple string.
If I look at core/modules/jsonapi/src/Normalizer/FielditemNormlizer.php, this hints as cacheability but does not actively allow so:
To make matters worse, jsonapi explicitly does not allow custom jsonapi_normalizers:
core/modules/jsonapi/src/Serializer/Serializer.php
For now we solved this with a simple core patch that removes the serrializer construct and a extended class that adds appropriate cache tags to specific computed fields at field_item level using its parent field_item_list name.
Comment #118
bbralaI've created the test for the
EntityTestComputedFieldin the same manner as theEntityTestMapField. I've verified some tests fail when the expected cache tags are not provided, also when the field is removed as sparse fieldset it also fails as expected.We could optimize this test by not testing everything which would save a bit of time, but not sure if we should really do that.
I've chosen not to fill the
computed_reference_field<code> since that was a lot of hassle since it also needs the <code>EntityTestentity to be fully set up.Comment #119
bbralaAccidentally kept a method that wasn't needed anymore (thank you cspell).
Comment #121
bbralaFixed some naming issues.
JSON:API needs an UUID to be able to use entities. The computed doesn't have that so i added that. This breaks
EntityTestComputedFieldNormalizerTestso i added uuid to the expected output.Not sure why the taxonoy test was failing.
Comment #122
bbralaComment #123
bbrala#friday-afternoon
Comment #124
mglamanI've gone through the changes since my last review in #108. I'm happy with the JSON:API test coverage! I think it is safe to remove the Needs Tests tag. It's also helped add test coverage of computed fields in JSON:API regardless of the cacheability needs.
Comment #125
bbralaThanks @mglaman :)
Comment #126
alexpottCommitted 5ff249f and pushed to 9.3.x. Thanks!
Will backport to 9.2.x is the test run is successful there.
Comment #128
bbralaThanks Alex. The failing test is probably the fact we added drupal_internal__target_id to the meta tag in 9.3.x in jsonapi.
Comment #129
jibranYay!!! Thank you for the commit. Do we need to publish https://www.drupal.org/node/2865042? It is marked against 8.4.x.
Comment #130
bbrala@alexpott: backported the patch to 9.2.x. As i already thought, the addition of the
drupal_internal__target_idin the meta information of jsonapi was the culprit.Comment #131
bbralaThe fail was a result of #3036593: Add 'drupal_internal__target_id' to JSON:API representation of entity reference fields, because that can't be retrieved from the target resource for target entity types without corresponding resources
Comment #132
tivi22 commentedHi, please help. Could someone take a look at this ticket: https://www.drupal.org/project/drupal/issues/3252278 ? Thanks!
Comment #134
alexpottI never got round to the backport. Thanks to @bbrala for reminding me. 9.2.x is security only now so the backport will never occur.