a
dd

It seems the 'Formatter for Image' was missing on first save.

Comments

ykyuen’s picture

I have the same problem.

claudiu.cristea’s picture

Status: Active » Postponed (maintainer needs more info)

I tried to reproduce the error but no luck. Does it still occur?

ndfarm’s picture

Issue summary: View changes

I have the same problem. I found out, that the image style is saved if I don't upload an image on the first node save.
But when I then edit the node and add an image, the image style is empty again.

Any ideas?

jamiroconca’s picture

try to change in function formatter_field_field_widget_form

// Populate $items from $form_state values if available.  This is necessary
  // for the #ajax functionality.
  if (!empty($form_state['values'])) {
    $path = array($field['field_name'], $langcode);
    $items = drupal_array_get_nested_value($form_state['values'], $path);
  }

with

// Populate $items from $form_state values if available.  This is necessary
  // for the #ajax functionality.
  if (!empty($form_state['values'][$instance['field_name']])) {
    $path = array($field['field_name'], $langcode);
    $items = drupal_array_get_nested_value($form_state['values'], $path);
  }
joe_f’s picture

Thanks jamiroconca!

This fix worked for me :-)

stefan.r’s picture

Priority: Normal » Major
Status: Postponed (maintainer needs more info) » Reviewed & tested by the community
StatusFileSize
new602 bytes

We have the same problem when editing a node and changing an existing image in a media field. When we remove the image we lose the formatter settings (data loss!), and the new empty settings get saved incorrectly as the image_style and image_link keys aren't set, which causes #1696524: Undefined index: image_style in image_field_formatter_settings_form.

Upgrading priority to critical because of data loss and as this also causes a notice when viewing a page with nodes that have formatter fields. Any drupal_set_message causes pages not to be cached, which can be a problem on high-traffic sites.

The linked patch solves the issue and looks great to me!

stefan.r’s picture

Title: The formatter setting doesn't work on node save, only works on node edit » The formatter setting doesn't work on node save or on node edit when changing the image
Priority: Major » Critical
drusite’s picture

It doesn't work, maybe because of the new core version?

sgdev’s picture

Can confirm patch #6 fixes the issue. Really need to get this committed.

sgdev’s picture

Version: 7.x-1.0-beta2 » 7.x-1.x-dev

Also this is an issue in both 7.x-1.0-beta3 and 7.x-1.x-dev, so tagging this to dev.

jurriaanroelofs’s picture

the module still needs this patch.. +1

  • JurriaanRoelofs committed 1ae602b on 7.x-1.x
    fix issue #1394566 by stefan.r: The formatter setting doesn't work on...
jurriaanroelofs’s picture

Version: 7.x-1.x-dev » 7.x-1.0-beta5
Status: Reviewed & tested by the community » Fixed

_

Status: Fixed » Closed (fixed)

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