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.

Comments

phenaproxima created an issue. See original summary.

phenaproxima’s picture

Status: Active » Needs review
StatusFileSize
new2.77 KB
new6.67 KB

Behold!

phenaproxima’s picture

StatusFileSize
new3.65 KB

Yikes, sorry. I mis-rolled the passing patch.

The last submitted patch, 2: 3069725-2-PASS.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

The last submitted patch, 2: 3069725-2-FAIL.patch, failed testing. View results

Status: Needs review » Needs work

The last submitted patch, 3: 3069725-2-PASS.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

phenaproxima’s picture

Status: Needs work » Needs review
StatusFileSize
new3.32 KB

Sorry again. This oughta work.

phenaproxima’s picture

Status: Needs review » Fixed

Thanks, @richgerdes!

richgerdes’s picture

Thanks! The patch looks good. I've committed it and created a new beta 6 release.

phenaproxima’s picture

Issue summary: View changes

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.