Similar to http://drupal.org/node/224092 but an extra '<' character is appended before the closing HTML tag (i.e. turns into <. The 6.x-1.6 release notes list issue 224092 as resolved but the slightly different problem at hand still persists after upgrading and clearing cache. Attached is a patch that I'm using to remedy this.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

adzio’s picture

Meant to say </a> turns into <</a>

NancyDru’s picture

Assigned: Unassigned » NancyDru
Status: Active » Postponed (maintainer needs more info)

I'm not seeing this after I made a few changes. Can you please try the -dev version this evening and see if you still see it? If you do, please tell me what kind of term indicator you are using.

adzio’s picture

Yes, 2008-Oct-03 dev still has the bug I originally reported. My patch above remedies the original problem I saw.

However, I'm seeing a new occurrence of an extra < character now appearing (after we have changed some Glossary settings) - looks like it's now related to using the <abbr> tag. I may be able to provide you with some test case data next week if you hit a wall with this issue.

NancyDru’s picture

Okay. It's hard for me to know if it's fixed when I can't reproduce it. And I do test things.

adzio’s picture

No doubt. Please try the following: <p><strong>What is Foobar</strong></p> where Foobar is a Glossary term. What I'm getting is along the lines of: <p><strong>What is <a class="glossary-term" href="/glossary/term/10"><abbr title="(...)">Foobar</abbr></a><</strong></p>

NancyDru’s picture

Hmm, I still don't see it. Is this only happening on short phrases where the term is at the end? Are you using substring substitution? Have you tried it without the <strong>?

adzio’s picture

The <strong> comes from FCKEditor. Perhaps the conditions to replicate this bug are more complex (more complex nesting of tags or very tag- or term- specific condition).. I am currently unsure if I can use the verbatim HTML that we have on our site as a test case for you for various reasons. In the meantime will be on the lookout for an easy HTML that brings this bug to life, but at this point it is still clearly there.

NancyDru’s picture

Aaarrrggghhh! WYSIWYG editors are the bane of module developers' lives. Please turn it off and see if you can recreate the problem.

adzio’s picture

FileSize
9.43 KB

I understand your frustration with WYSIWYG editors (I've had my share of pain with them heh) but we are obligated to provide this functionality for our users. Please find a sample html attached that breaks as specified above after the Glossary filter is applied - please try it and let me know if you are able to reproduce the problem on your side.

When using the html attached, the contents of the first <h3>...</h3> are replaced with <h3><b>What is <a class="glossary-term" href="/glossary/term/173"><abbr title="A legal process that involves the sale of a mortgaged property in order to pay the loan of the defaulting borrower. Foreclosure laws are based on the statutes of each state. ">Foreclosure</abbr></a><</b></h3>

The order of filters applied to this content is: URL filter, HTML filter, Line break converter, HTML corrector, Glossary filter.

adzio’s picture

Status: Postponed (maintainer needs more info) » Active

Were you able to reproduce the bug? Note the use of basic HTML tags in the attached content. Changing Status to active.

NancyDru’s picture

I took a short vacation so I'm still trying to catch up.

adzio’s picture

Any luck?

NancyDru’s picture

Still catching up. Real Life™ seems to be very hectic lately.

codeknitter’s picture

I have run into this problem, and I don't use a WYSIWYG editor on my site. I have the module temporarily turned off, but I'd be happy to turn it on and give you a url if that will help.

In my case, I used G2 before updating glossary, and I'm wondering if that may actually be part of the problem.

michellezeedru’s picture

I am seeing this problem as well. I did not use G2 before (as codeknitter had), but am using FCKeditor. I tried disabling FCKeditor, but the extra > is still showing when Glossary is enabled. It was running without problems, so I'm unsure why it suddenly started adding the extra >. I did do a recent upgrade to a newer version of FCKeditor, and it's possible this problem started after that, but I can't be sure.

Would appreciate your help on this problem. Let me know if there's anything I can do in testing.

adzio’s picture

mziegmann - you may want to clear the cache after you disable FCKeditor to really test whether disabling it would fix it - the content gets cached after the first parse (view).

nancydru - there are now three separate cases of the same problem, would it be possible to dedicate some cycles to analyzing this problem?

webchick’s picture

Status: Active » Needs review

Nate/quicksketch looked into this and found it only happens when the mbstring extension is not available. That probably explains why it's reproducable in some environments and not others.

To reproduce this on a server *not* having this problem, change the following line in glossary.module:

  $multibyte_enabled = extension_loaded('mbstring');

to:

  $multibyte_enabled = !extension_loaded('mbstring');

And in includes/unicode.inc change:

if (!function_exists('mb_strlen')) {

to:

if (function_exists('mb_strlen')) {

(basically trick it into thinking your server isn't up to par)

Then voila; arrows everywhere! :)

I can confirm that this patch fixes the issue, although I'm not positive it's the correct fix. Worthy of "needs review" at any rate.

webchick’s picture

And fwiw, our glossary settings are:

Match type: Word
Case sensitivity: Case insensitive
Replace matches: All matches
Blocked elements: abbr acronym
Link type: normal
Term indicator: use abbr element

-e-train’s picture

Status: Needs review » Reviewed & tested by the community

I have added the patch fix above and it seems to work fine for me as well. thank you...

Dialer3’s picture

That patch does not work. Glossary module still adds < to external links in a text. Waiting for solution...

socratesone’s picture

I've applied the patch, as well. It did not appear to be working at first. I cleared the cache and it seems to work fine.

dkingofpa’s picture

bump

carn1x’s picture

I'm still having this issue, the patch did not work for me.

The issue only seems to be occurring under special circumstances for me, that is, if the next character after the term is a "<", whether a closing tag wrapping the term, or an open tag unrelated to the term, then another "<" will be added to the output.

EDIT: Ok totally didn't read properly the first time. Installing php-mbstring fixed this issue for me.

greenrover33’s picture

FileSize
4.83 KB

I have had the same issue.
To solve it i reimplemented the _glossary_insertlink() function.

Open Issue:
I dont understand what for the rtl and ltr stuff should be? Why i have to watch for this here?
My version dosent have this. Do right to left writing people do: [code]some crazy letters[/code]. Or do they have to use normal html (codes) like all other?

mgifford’s picture

bump!

NancyDru’s picture

Issue summary: View changes
Status: Reviewed & tested by the community » Closed (outdated)