I'm using the icon display, but I've noticed that this module also inserts its icons when the content is edited in a WYSWYIG editor, specifically FCKeditor. Each time the content is saved, then, the content has an additional icon. I had one node with three icons. Is there a way to exclude this from happening when the content is bought into the editor?

Comments

mandclu’s picture

Thinking more about this, I think the logical solution is to remove all icons when the content is loaded into the edit form, probably using hook_nodeapi and the 'prepare' operation.

The only complication for me is that I've also decided that even though I'm using icons, I also want the actual matched text to also link to the term page (for SEO purposes). SO I'm going to tinker with this, but the code that ultimately solves my problem may not be for everyone.

mandclu’s picture

Hmmm, it seems the root of the problem is actually the way FCKeditor loads in the content for edit. I can see now why NancyDru is so frustrated with WYSIWYG editors. Essentially that breaks one of the core Drupal concepts that the user's initial input should presented back to them for edit.

In any case, it turns out a simple fix for my particular issue is to add the following to the top of _glossary_filter_process:

  if (strcmp($_REQUEST['q'], 'fckeditor/xss') == 0) {
    return $text;
  }

A more general way to handle it would be to strip out any existing glossary markup before adding more in, but that may be overkill.

zoon_unit’s picture

I too, have run into this problem. I hope the developers will develop a fix for this. I'm not sure where or how to apply the patch shown above, but it looks simple enough that the module developers should be able to make a quick fix.

nancydru’s picture

Status: Active » Fixed

Committed on both branches.

Status: Fixed » Closed (fixed)

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