When using select or other for a custom og:type I get the following error every time I save a node.

Notice: Undefined index: #other_delimiter in select_or_other_element_process() (line 138 of /Users/marcus/hosts/drupal7/sites/all/modules/contrib/select_or_other/select_or_other.module).
Notice: Undefined index: #other_delimiter in select_or_other_element_process() (line 163 of /Users/marcus/hosts/drupal7/sites/all/modules/contrib/select_or_other/select_or_other.module).
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

marcus178’s picture

Any ideas on this, would be nice to get rid of it.

DamienMcKenna’s picture

I've not had a chance to test it yet, but I will soon.

shahinam’s picture

Issue summary: View changes

In widget settings form the other_delimiter form element is commented.
The comment above it says:

There are design issues with saving multiple other values with some field widgets - this needs a rethink.

So it is obvious it will throw notice, where ever we try to fetch this array key.
Attached is a simple, patch to comment out those lines.

shahinam’s picture

shahinam’s picture

Status: Active » Needs review

Status: Needs review » Needs work

The last submitted patch, 4: undefined-index-2086643-8585801.patch, failed testing.

shahinam’s picture

Project: Metatag » Select (or other)
Version: 7.x-1.0-beta7 » 7.x-3.x-dev
Component: User interface » CCK / Field API widget

Oops, this is not metatag module issue.
Instead select_or_other has this issue. Assigning to that project.

shahinam’s picture

Status: Needs work » Needs review
haydeniv’s picture

Version: 7.x-3.x-dev » 7.x-2.x-dev
Status: Needs review » Needs work

Commenting out the offending lines doesn't fix the problem, it only hides the symptoms.

shahinam’s picture

Agreed!
As mentioned in comment, I did this because the form element is commented in select_or_other.field_widget.inc on line 285

  /*
  There are design issues with saving multiple other values with some field widgets - this needs a rethink.

  $form['other_delimiter'] = array(
    '#type' => 'textfield',
    '#title' => t('Other delimiter'),
    '#description' => t("Delimiter string to delimit multiple 'other' values into the <em>other</em> textfield.  If you enter <em>FALSE</em> only the last value will be used."),
    '#default_value' => isset($settings['other_delimiter']) ? $settings['other_delimiter'] : ', ',
    '#required' => TRUE,
    '#size' => 5,
  );
  */
jstoller’s picture

I just updated to Select (or other) 7.x-2.21 and it looks like this bug may have been fixed. Can anyone else confirm this?

legolasbo’s picture

Status: Needs work » Fixed

A lot of notices were fixed in 2.21, Let's assume this was one of them.

Status: Fixed » Closed (fixed)

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

bbdata’s picture

Component: CCK / Field API widget » Field widget (non-specific or listed)
FileSize
950 bytes

I am testing the upgrade of select_or_other to v2.22 on a drupal 7.50 install and found that these two notices still appear when I am on a node create form that has a select field.

I patched it by checking if $element['#other_delimiter'] is empty on line 138 and 163.

bbdata’s picture

Status: Closed (fixed) » Needs review
pribeh’s picture

@bbdata, I'm getting the same. I've tried your patch but I'm getting:

patch unexpectedly ends in middle of line
Hunk #2 succeeded at 159 with fuzz 1.

legolasbo’s picture

Status: Needs review » Needs work

Setting to needs work per the comment in #16

lolandese’s picture

Status: Needs work » Needs review
FileSize
639 bytes

Simpler. Against 7.x-2.x.

daften’s picture

Status: Needs review » Closed (outdated)

Closing as outdated because no activity in a long time and Drupal 7 goes EOL soon. Feel free to re-open if needed.