When a Field Formatter Settings Module comes looking for the instance display settings all it can find is the default one set in line 985 and so it often chokes because it is looking for something else often (custom displays) and with more details (type, etc):

    'instance' => array('display' => array('default' => array('settings' => array()))),

because this is a DS field it has no fully stocked $instance array for the summary unless we make one...so...here is a feeble attempt at pacifying hook_field_formatter_settings_summary_alter() by passing in the current view mode along with some defaults to avoid more notices:

     'instance' => array(
      'display' => array(
        $view_mode => array(
          'label' => '',
          'type' => '',
          'weight' => '',
          'settings' => array(),
          'module' => '',
        )
      )
    ),
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jpstrikesback’s picture

Status: Active » Needs review
FileSize
733 bytes

And the patch.

swentel’s picture

Interesting, there was another bug report ove at #1875750: Allow DS core fields to have alterable settings, include them in field_info_instance_settings() with a patch, but smaller. I think this one is probably better and solving it competely.

jpstrikesback’s picture

Cool! I missed that one. Would we ever need/want anything else in the instance array, or is this good enough for DS purposes?

swentel’s picture

I /think/ that should be enough. I'm going to test this one over the weekend with other field formatter settings modules to see how it behaves.

markhalliwell’s picture

Kinda reiterating what I said in #1875750-6: Allow DS core fields to have alterable settings, include them in field_info_instance_settings(), but this would in fact silence the errors (which is similar to that issue). However it doesn't actually allow the settings for those fields to be saved.

swentel’s picture

Status: Needs review » Fixed

I've committed this one, let's figure out in the other one how to actually save :)

Status: Fixed » Closed (fixed)

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