I've been using the Glossary module for a while and have about 300 terms, many with 3 or 4 synonyms.

Until this morning I was showing "All matches" and everything was working perfectly. Now I've changed the settings in my glossary filter from "All matches" to "Only the first match" and hit a problem. Hopefully this example will illustrate it:

Term name:
Full Name and other bits

Synonyms:
Full Name
Full Name and a different bit

Node body text:
........ Full Name and other bits ...... (the first place any variation of this term is mentioned)

I expected the entire string "Full Name and other bits" to be highlighted with a glossary link, but only "Full Name" is highlighted. Looking at the code, it is the first term/synonym found from the synonym list that is matched not the first occurrence of any variation of the term in the node body text, which seems the wrong way round.

I'm using 6.x-1.x-dev from 2009-Jan-20.

Comments

linl’s picture

Status: Active » Needs review
StatusFileSize
new1.96 KB

Attached is a patch for this against 6.x-1.x-dev version from 2009-Jan-20.

If "Only the first match" is set, it now checks for the first occurrence in the text of any of the term's synonyms, rather than matching the first found in the synonym list.

drupalfan2’s picture

Is this patch already in latest version? Which version?

linl’s picture

No, it isn't in any version yet. It is a patch against the latest development version, 6.x-1.x-dev from Jan 2009.

tlaurent’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new2.02 KB

Just re-released the patch from #1 to be compliant with Git patching.
It'd be nice if this patch could be committed in a stable release as it does indeed fix multiple issues when using synonyms.

nancydru’s picture

Status: Reviewed & tested by the community » Needs review

Thanks. I am currently working on a security issue, so this will have to wait for that. The good news is that I have been forced to get my head around Git now.

It is not proper to mark your own issue as RTBC; that should be done by others.

tlaurent’s picture

Hi Nancy,

I didn't create this issue nor did I create the patch #1. I only applied the patch from #1, tested it, saw that it worked and was doing what it claimed. I thought that what I did was exactly RTBC...
The only thing I did was to reformat the patch from #1 so that it get accepted when being applied with git (it's the same patch but in Git compatible format).

I thought people would appreciate that someone finally tested a patch so that a 3 years old issue could have a chance to be closed.

nancydru’s picture

Well, I can't speak for anyone else, but I appreciate it. I'm also hopeful that I can now get back into the swing of things in maintaining my modules.

linl’s picture

I appreciate it too, tlaurent. Happy you tested the patch and it worked, but guess I can't RTBC it either.

nancydru’s picture

That's not an absolute necessity for contributed modules because of so few people who are available for testing. Right now we are waiting for action from the Security Team; after that Mr. Laurent may commit it himself if he is satisfied with his testing.

nancydru’s picture

Issue summary: View changes
Status: Needs review » Closed (outdated)