Download & Extend

add tag script doesn't work

Project:Community Tags
Version:5.x-1.x-dev
Component:User interface
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active

Issue Summary

When I click on the "add" button for the tag input form, nothing happens. Firebug shows this error:

jquery.js (line 2)
o.tags.push is not a function
addHandler()community_tags.js (line 53)
e(click clientX=0, clientY=0)jquery.js (line 2)
[Break on this error] o.tags.push(textfield[0].value);

I've tried the form as both a block and inline, and I get the same problem either way.

Comments

#1

I get this as well with FF2.0.4. It appears that the empty array being set in the settings isn't picked up as an array, and thus doesn't have the .push method.

#2

Confirming the above, placing this bit of code before the o.tags.push(textfield[0].value); stops that particular bug:


if(!o.tags[0]) {
o.tags = new Array;
}

I can make a patch for this, but I suspect there's probably a "better" solution out there.

#3

I receive the same error in FireBug, and the fix from joshk makes it go away. I'm not sure what a more elegant solution would be, but I'd say go ahead and roll a patch for it anyway.