Problem/Motivation
If you have an entity type with a computed entity reference base field, the JsonApiGenerator class's getPaths() method breaks because it tries to call getCardinality() on NULL. This is because EntityFieldManagerInterface::getFieldStorageDefinitions() specifically ignores computed base fields.
Proposed resolution
Use getFieldDefinitions() instead, which does not ignore computed base fields.
Remaining tasks
Fix it, plus a regression test.
User interface changes
None.
API changes
None.
Data model changes
None.
Release notes snippet
None.
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | 3069725-7.patch | 3.32 KB | phenaproxima |
| #3 | 3069725-2-PASS.patch | 3.65 KB | phenaproxima |
| #2 | 3069725-2-PASS.patch | 6.67 KB | phenaproxima |
| #2 | 3069725-2-FAIL.patch | 2.77 KB | phenaproxima |
Comments
Comment #2
phenaproximaBehold!
Comment #3
phenaproximaYikes, sorry. I mis-rolled the passing patch.
Comment #7
phenaproximaSorry again. This oughta work.
Comment #9
phenaproximaThanks, @richgerdes!
Comment #10
richgerdesThanks! The patch looks good. I've committed it and created a new beta 6 release.
Comment #11
phenaproxima