I'm getting an AJAX error 500 trying to select "Image with sizes" format. Watchdog shows:
Notice: Undefined index: in picture_field_formatter_settings_picture_sizes_formatter_summary() (line 826 of /home/m/mobistyle/promotex/public_html/sites/all/modules/picture/picture.module).
Here's the line:

$summary[] = t('Fallback image style: @style', array('@style' => $image_styles[$settings['fallback_image_style']]));

If I comment it out or replace $image_styles[$settings['fallback_image_style']] with a blank string I can get it to load fine.

This doesn't occur when selecting "Picture" format - in the same place its corresponding picture_field_formatter_settings_picture_sumary() function has this test:

$picture_mapping = picture_mapping_load($settings['picture_mapping']);
  if ($picture_mapping) {
    $summary[] = t('Picture mapping: @picture_mapping', array('@picture_mapping' => $picture_mapping->label()));
    $image_styles = image_style_options(FALSE);
    unset($image_styles['']);
    if (isset($image_styles[$settings['fallback_image_style']])) {
      $summary[] = t('Fallback Image style: @style', array('@style' => $image_styles[$settings['fallback_image_style']]));
    }
    else {
      $summary[] = t('Automatic fallback');
    }

    $link_types = picture_link_types($instance);
    // Display this setting only if image is linked.
    if (isset($link_types[$settings['image_link']])) {
      $summary[] = filter_xss_admin($link_types[$settings['image_link']]);
    }
  }
  else {
    $summary[] = t('Select a responsive image mapping.');
  }

On another installation I can select "Image with sizes" formatter but if I try to save the field display without providing formatter settings, the error shows up again. This behavior was tested both on picture-2.13 and the current dev version.

Comments

kurapov created an issue. See original summary.

kurapov’s picture

Title: Undefined index: in » Undefined index: in picture_field_formatter_settings_picture_sizes_formatter_summary()
attiks’s picture

Assigned: Unassigned » jelle_s
jelle_s’s picture

Status: Active » Fixed

Since the fallback image style is a required setting for the "Image with sizes" formatter, I gave it a default value (we can't really do an automatic fallback here as we don't have a PictureMapping here). Added a few failsafes as well. Fixed in latest dev.

  • Jelle_S committed c1ad92b on 7.x-2.x
    Issue #2621338: Undefined index: in...

Status: Fixed » Closed (fixed)

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