While working on #2824851: EntityResource::patch() makes an incorrect assumption about entity keys, hence results in incorrect behavior, I ran into an explicable bug. A second item on a single-cardinality field was being set. Which should have caused tests to fail, because the field was different.
But, when normalized … the field was actually still the same! WTF, right?!
Turns out \Drupal\jsonapi\Normalizer\Value\FieldNormalizerValue::rasterizeValue() helpfully respects the cardinality of the field … but then also silently ignores any additional fields. An assertion verifying this precondition would have saved me tons of time.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | 2939800-2.patch | 631 bytes | wim leers |
Comments
Comment #2
wim leersComment #3
wim leersComment #4
wim leersGreat, tests pass, let's do this.
Comment #6
wim leers