sfDoctrineActAsTaggablePlugin displays JavaScript array methods as tags
I recently stumbled upon some strange behaviour in a Symfony 1.4 Apostrophe project. The built-in media browser uses sfDoctrineActAsTaggablePlugin. Whenever I added some new media item or edited an existing one, a list of strange tags were added to the list of tags, which appeared to be JavaScript array methods (see the screenshot).
Apparently, serveral of the “for-in” statement in the plugin’s JS file loop over array methods as if they were elements of the array. The problem is fixed by making use of the jQuery .each() method to loop over the array elements. You can download the fixed JS file here: pkTagahead.js.
Until the fix is added to the sfDoctrineActAsTaggablePlugin trunk, you may fix the problem in the following way:
- Remove the symlink
/web/sfDoctrineActAsTaggablePlugin - Create a directory
/web/sfDoctrineActAsTaggablePlugin - Create a directory
/web/sfDoctrineActAsTaggablePlugin/js - Copy the fixed
pkTagahead.js(download link above) to this directory

All you have to do is not mix MooTools and jQuery….