I have both some tags I created and free tagging enabled. When I create content, a story, for example, and I enter a character into a vocabulary autocomplete field and that character is not found in any of my created tags, some code appears in the drop-down box where matched tags would be displayed. The code is as follows:

function (_215) {
  var _216 = this;
  for (var i = 0; i < _216.length; i++) {
    if (_215 == _216[i]) {
      return true;
    }
  }
  return false;
}
function (a) {
  for (var i = 0; i < a.length; i++) {
    this.push(a);
  }
  return this;
}

If the character entered matches a character found in any of my tags, those tags are displayed normally.

Comments

kc1981’s picture

I was having the same problem with the same code showing up. I found it in the file XinhaCore.js in the HTMLArea module around lines 3145 - 3174.

If I disable the the visual editor for my account, then the code no longer shows up.

However, the quickest/best workaround I found was to change line 1511 in taxonomy.module in function taxonomy_autocomplete() from

print drupal_to_js($matches);
to

if($matches) print drupal_to_js($matches);
else print '{ }';

This checks to see if there are any matches before sending back anything.

I don't know if this is the best solution, but it seems to work so far.

sun’s picture

Status: Active » Closed (duplicate)

I guess this has been resolved in the meantime, or won't be resolved for D5 anymore.