I got some error about Undefined index Erro in Select (or other) module

Notice: Undefined index: 121 in select_or_other_taxonomy_default_value() (line 170 of /modules/contrib/select_or_other/select_or_other.field_widget.inc).
Notice: Trying to get property of non-object in select_or_other_taxonomy_default_value() (line 170 of /modules/contrib/select_or_other/select_or_other.field_widget.inc).
Notice: Undefined index: 121 in select_or_other_taxonomy_default_value() (line 170 of /modules/contrib/select_or_other/select_or_other.field_widget.inc).
Notice: Trying to get property of non-object in select_or_other_taxonomy_default_value() (line 170 of /modules/contrib/select_or_other/select_or_other.field_widget.inc).

It seems when the $term is empty, the error occurred.

I have applied a patch for this error.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

wangzb265’s picture

FileSize
916 bytes
legolasbo’s picture

Status: Patch (to be ported) » Needs review

Patches should be submitted via the issue tracker. Create a bug report or feature request, attach your patch using the file upload form. Set the issue's status to "needs review" or "needs work". Setting the status to one of these options is important as it adds the issue to the patch queue.

Setting the status to "needs review". Please see https://www.drupal.org/patch/submit for more information about submitting a patch.

Status: Needs review » Needs work

The last submitted patch, 1: select_or_other_empty_term.patch, failed testing.

legolasbo’s picture

Testing failed because the patch can not be applied. Looking at the patch this is because it is formatted relative to your docroot/sites/all directory. It should be formatted relative to select_or_other's directory.

wangzb265’s picture

Hi legolasbo,

Thanks for the review. I have recreated the patch. This time the patch should be against the select_or_other's directory.

The last submitted patch, 1: select_or_other_empty_term.patch, failed testing.

legolasbo’s picture

Status: Needs work » Needs review

Whenever a patch fails testing, the status is automatically reset to Needs work. In order to have the new patch tested, the issue status needs to be changed to Needs review

wangzb265’s picture

I just uploaded the patch and rename it with a Drupal normal patch name.

The status is Needs review now.

Thank you,

legolasbo’s picture

Issue tags: +Quick fix
legolasbo’s picture

@wangzb265,

Can you describe the steps to reproduce this issue. I've been unable to reproduce the problem so far.

legolasbo’s picture

Status: Needs review » Closed (cannot reproduce)

I've done a lot of work on the taxonomy integration, which is now separated into it's own sub-module. During this effort practically everything taxonomy related has been rewritten.

Since I am unable to reproduce the problem I'm closing the issue. Please reopen the issue if it is still relevant in the current codebase.