Notice: Undefined index: mode in active_tags_field_widget_form() (line 71 of C:\xampp\htdocs\drupal7beta3\sites\all\modules\active_tags\active_tags.module).

70  drupal_add_css(drupal_get_path('module', 'active_tags') . '/active_tags.css');
71  drupal_add_js(array('activeTags' => array('mode' => $settings['mode'])), 'setting');
72  drupal_add_js(drupal_get_path('module', 'active_tags') . '/active_tags.js');
CommentFileSizeAuthor
#20 undefined_index-1099478-20.patch423 bytesAnonymous (not verified)
#10 active_tags_1099478_v2.patch571 bytesalduya
#7 active_tags_1099478_v1.patch641 bytesalduya

Comments

3rdLOF’s picture

Same here.

sol roth’s picture

I also have this problem.

bryancasler’s picture

Resolved this issue by removing my tags field and then re-adding it

bryancasler’s picture

I take that back, it seems to have fixed it for one field. Everything else is broke.

bryancasler’s picture

Seems to go away if certain conditions are met.

1: Taxonomy category has at least one term in it
2: Your content type has at least one node created

dragonwize’s picture

This is simply a PHP Notice. It is not an error or warning and does not affect any functionality at all. In PHP is just there to help keep developers on their toes about uninitialized variables being used, which is perfectly valid and part of the point of using a dynamically typed language.

You are seeing this because Drupal 7 by default has them enabled. You can set your error display and logging settings at /admin/config/development/logging. Setting it to errors and warnings only will prevent you from seeing only real errors that would harm your site.

You can also save your field again so that the value is initialized and it should go away.

I will fix this by just running and isset test on the var but this is not on the top of my priorities because it is not in any way vital or even an error.

alduya’s picture

Status: Active » Needs review
StatusFileSize
new641 bytes

@draginwize: Does this patch do what you intended?

3rdLOF’s picture

@alduya That did it. Thanks

dragonwize’s picture

Status: Needs review » Needs work

Close but not quite. The mode is required for use on the front end so the variable will need to be tested and if not there set to the default value. The drupal_add_js call should always happen.

alduya’s picture

Status: Needs work » Needs review
StatusFileSize
new571 bytes

@dragonwize: And this?

dragonwize’s picture

Status: Needs review » Reviewed & tested by the community

Correct. Very good. I will commit when I get a free moment near my code.

ranavaibhav’s picture

#10 fixed the issue for me.

mariagwyn’s picture

patch fixed error.

Anonymous’s picture

#10 worked for me

Anonymous’s picture

Patch works, but I wonder why $instance['widget']['settings']; does not include a ['mode'] by default?

PI_Ron’s picture

No I have both of these conditions and I am getting the notice.

I did however change the widget type on an existing term field, not create a new one with this widget.

PI_Ron’s picture

#10 Patch works

backwardgraphics’s picture

I can confirm #10 takes care of this issue.

marcoka’s picture

patch #10 works

Anonymous’s picture

StatusFileSize
new423 bytes

The correct way to fix this bug is to include the default setting in the implementation of hook_field_widget_info() at the top of the module file. This saves having to check for the existence of the key, and it allows you to set the default for all widget instances that haven't been configured. (This is a common case here, because most of us are clicking the widget name in the field settings page of Field UI and simply changing the widget.)

So while #10 works, it is not the right way to fix this problem.

New patch attached.

JohnnyX’s picture

Patch #20 works for me (first short tests). Could it commited and a new release/ dev version created?

BeaPower’s picture

Will you commit this patch to the next release?

haydeniv’s picture

#20 looks good, applies against dev, fixes problem.

dragonwize’s picture

Status: Reviewed & tested by the community » Fixed

Committed. Thanks to all involved.

Status: Fixed » Closed (fixed)

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