Saving products produces this error message:

Notice: Undefined index: text_processing in _text_sanitize() (line 320 of /Users/joachim/Sites/greaves-drupal/modules/field/modules/text/text.module). Backtrace:

_text_sanitize(Array, 'und', Array, 'value') text.module:264
text_field_formatter_view('commerce_product', Object, Array, Array, 'und', Array, Array) field.default.inc:210
field_default_view('commerce_product', Object, Array, Array, 'und', Array, 'default', NULL) field.attach.inc:209
_field_invoke('view', 'commerce_product', Object, 'default', NULL, Array) field.attach.inc:385
_field_invoke_default('view', 'commerce_product', Object, 'default', NULL, Array) field.module:899
field_view_field('commerce_product', Object, 'commerce_eu_vat_rate', 'default', 'en') commerce_product_reference.module:330

This is because the text_default formatter that we're setting as our default requires an instance setting:

/**
 * Implements hook_field_info().
 *
 * Field settings:
 *   - max_length: the maximum length for a varchar field.
 * Instance settings:
 *   - text_processing: whether text input filters should be used.
 *   - display_summary: whether the summary field should be displayed.
 *     When empty and not displayed the summary will take its value from the
 *     trimmed value of the main text field.
 */
function text_field_info() {
  return array(
    'text' => array(
      'label' => t('Text'),
      'description' => t('This field stores varchar text in the database.'),
      'settings' => array('max_length' => 255),
      'instance_settings' => array('text_processing' => 0),
      'default_widget' => 'text_textfield',
      'default_formatter' => 'text_default',
    ),

Comments

joachim’s picture

Title: use of 'text_default' field formatter requires a 'text_processing' isntance default setting » use of 'text_default' field formatter causes error messages
Priority: Normal » Critical

It's worse that that it turns out:

 * @param $column
 *   The column to sanitize (either 'value' or 'summary').
 *
 * @return
 *  The sanitized string.
 */
function _text_sanitize($instance, $langcode, $item, $column) {

That expects $column to be only one of two things. And this is called by text_field_formatter_view(), with:

        $output = _text_sanitize($instance, $langcode, $item, 'value');

However, our $item won't have that column because our field doesn't work that way.

Hence I suspect that we can't use the formatter from text module at all, because it expects field schema columns which we don't have.

joachim’s picture

Title: use of 'text_default' field formatter causes error messages » add default formatter

The text formatter isn't going to cut it at all. Let's add a dedicated one.

joachim’s picture

Status: Active » Fixed

Fixed.

Rolling a new release.

Status: Fixed » Closed (fixed)

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