Problem/Motivation

Display modes are applicable at the entity type level, not the bundle level. And not all bundles have enabled corresponding display mode(s).

$form_display = $storage->load("$entity_type_id.$bundle.$mode");

So that $form_display could be NULL here, and furthermore, it's possible to set the object of EntityDisplayInterface to NULL, and this is where the bug existed.

Proposed resolution

Check NULL cases.

Comments

jungle created an issue. See original summary.

  • jungle committed a13c8bd on 8.x-1.x
    Issue #3103791: Not all bundles have enabled corresponding display mode(...
jungle’s picture

Status: Active » Fixed
jungle’s picture

Assigned: jungle » Unassigned

Status: Fixed » Closed (fixed)

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