Hi there,

After adding content with a select or other field as part of a field_collection field (see field_collection module), the following error is shown:
Notice: Undefined index: other_unknown_defaults in select_or_other_field_widget_validate() (regel 296 van /home/sjxofphr/domains/schijftijd.nl/public_html/sites/all/modules/select_or_other/select_or_other.field_widget.inc)

No clue what this is all about, but i hope i've provided enough info...

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

danielb’s picture

Title: Undefined index unknown_or_other_defaults line 296 » Undefined index other_unknown_defaults line 296
danielb’s picture

Project: Select (or other) » Field collection
Version: 7.x-2.5 » 7.x-1.x-dev
Component: CCK / Field API widget » Code

I reckon it must be how the field_collection module works.

Here is the code from select_or_other_field_widget_validate():

<?php
  $instance = &$form_state['field'][$field_name][$language]['instance'];
  if ($instance['widget']['settings']['other_unknown_defaults'] == 'available') {
?>

If the field settings for select_or_other were saved properly then there should be a value in $form_state['field'][$field_name][$language]['instance']['widget']['settings']['other_unknown_defaults'].

The field collection module must change the data that is usually available to this module?

pau1_m’s picture

subscribing

rellis’s picture

I think this is a problem in select_or_other -- see explanation
here http://drupal.org/node/1217150

And docs here:
http://api.drupal.org/api/drupal/modules--field--field.form.inc/function...

Attached is a patch for select_or_other.field_widget.inc

danielb’s picture

Project: Field collection » Select (or other)
Version: 7.x-1.x-dev » 7.x-2.x-dev
Component: Code » Miscellaneous
Category: support » bug
danielb’s picture

Status: Active » Fixed

I've committed rellis' patch, thanks.

Status: Fixed » Closed (fixed)

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

ezeedub’s picture

Title: Undefined index other_unknown_defaults line 296 » Undefined index other_unknown_defaults line 365
Status: Closed (fixed) » Active

This looks like it's back. I just got this error...

Notice: Undefined index: other_unknown_defaults in select_or_other_field_widget_validate() (line 365 of /path/to/drupal/sites/all/modules/contrib/select_or_other/select_or_other.field_widget.inc

danielb’s picture

Status: Active » Fixed

cheers, I've fixed that too.

Status: Fixed » Closed (fixed)

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

  • Commit 3a7c540 on 7.x-2.x, 7.x-3.x, 8.x-3.x by danielb:
    Issue #1297396 by rellis: Field instance fix, helps compatibility with...
  • Commit 49a76ec on 7.x-2.x, 7.x-3.x, 8.x-3.x by danielb:
    Issue #1297396 by danielb: Field collection 'other_unknown_defaults'...