Steps to reproduce:
- On admin/structure/types/manage/article/fields, create a new text field.
Submit the steps leaving default values, until you get back to the "Manage Fields" screen
- Visit admin/structure/types/manage/article/display/teaser : fatal error, unsupported operand type

Explanation:
Field UI creates fields and only adds explicit display settings for the 'default' mode, leaving the field hidden in all other modes. That's the expected behavior.
In #1785748: Field formatters as plugins we removed the fact that field_info_instance() "prepared" $instance['display'] to contain display settings for all existing view modes, including the ones not present in the definition that's actually stored - this more friendly memory-wise.

This is has been taken care of at entity_view() runtime, when determining the formatter to use for a field, nothing in $instance['display'][$view_mode] means 'field is hidden'.
This surprises Field UI, though, which still expects the entry to be present and tries to instanciate a formatter plugin with an invalid NULL argument.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

yched’s picture

Patch, with an added test
+ test-only patch

yched’s picture

Status: Active » Needs review
yched’s picture

Tests finished, but it seems the results never got back to the issue.
So, 'test only' patch failed as expected : http://qa.drupal.org/pifr/test/390538
And full patch passed : http://qa.drupal.org/pifr/test/390543

swentel’s picture

Status: Needs review » Reviewed & tested by the community

Great!

catch’s picture

Status: Reviewed & tested by the community » Fixed

Thanks! Committed/pushed to 8.x.

Status: Fixed » Closed (fixed)

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