Hello,

The glossary links are not added in the node page on words that have special characters, if these special characters are converted into html entities like they should, for example with a WYSIWYG editor like FCKeditor.

Example :
- in the vocabulary "Glossaire" I have a term "atmosphère"
- in a node body I enter somewhere "atmosph&eagrave;re" (plain text editor) or "atmosphère" in a WYSIWYG editor and the editor converts it into "atmosph&eagrave;re"
- the glossary link is not added on "atmosphère" when viewing the page, because in fact in the source code it is "atmosph&eagrave;re" and the glossary filter is looking for "atmosphère".

I tried to create the html entities converted term instead of the plain term with special characters, but it's not nice since in the glossary page, the output is the html entities code (example : the output in the glossary page is "atmosph&eagrave;re" and not "atmosphère".

Another solution would be to disable the html entities conversion of special characters in the WYSIWYG editor. It's possible with FCKeditor, but it's not very standards friendly.

I think the best solution would be if the glossary filter could look, for each term, for the real term (special characters) and for the html-entitified term. Do you agree with that ?

CommentFileSizeAuthor
#1 glossary-352545-1.patch2.64 KBGuillaumeDuveau
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

GuillaumeDuveau’s picture

Status: Active » Needs review
FileSize
2.64 KB

Here's a patch that does the job with extra code inside _glossary_get_synonyms.

If no WYSIWYG editor is installed (from the list fckeditor, tinymce, htmlbox, jwysiwyg, yui_editor, to be continued), then _glossary_get_synonyms does its job as usual.

If there is one, we're assuming the textarea will convert special characters to htmlentities, and that we need to have some kind of virtual synonyms :

école -> virtual synonym of école

The query has to be splitted into two recursive queries :
1) Fetch the terms of the vid and look if they have special characters. If yes, add the htmlentities version as a synonym.
2) Check if the term has any (real) synonyms. If yes, add the synonym. Then if the synonym has special characters, add the htmlentities version as well

It's my first patch that adds a feature in Drupal, I hope it's not too ugly. Maybe the feature should be chosen as an option in the glossary settings, but I believe that the automatic triggering if any WYSIWYG editor is installed is better.

GuillaumeDuveau’s picture

Hello,

What about that patch ? Would you be willing to integrate it if I update the patch to the latest dev ?
For now, Glossary is useless with a lot of languages and WYSIWYG editors.

See you
Guix

seren10pity’s picture

Thank you very mutch for this patch !!!

I'm french, I just created a new website, and I had the problem with the htmlentities conversion that were not understood by Glossary...

I just added the 'wysiwyg' module in the ' if condition ' of your patch ; and it rocks !

Thanks again ;)

GuillaumeDuveau’s picture

Thanks ! I'll add wysiwyg to a new patch against -dev if I get a positive review by Moshe.

GuillaumeDuveau’s picture

Bump, Nancydru would you like me to roll a new patch ?

milos1234’s picture

guix - please, that would be really helpful thanks!

i am using the current stable version, with a few modifications to get multi-language working properly. but am having much troubles with special characters in the other languages in the synonyms.

thanks!!

GuillaumeDuveau’s picture

I don't know which source to patch against, HEAD is still 5.x. DRUPAL-6--1 ?

jcbou’s picture

Subscribing

nonsie’s picture

Category: feature » bug
Priority: Normal » Critical

Bumping priority on this since it makes glossary on multilingual sites unusable.

NancyDru’s picture

Priority: Critical » Major

Adding the other spellings as synonyms should make it work.

@guix: I only use HEAD when starting a new Drupal branch, so HEAD will not be updated until I start on D7, which is going to be a bear because taxonomy terms become fields rather than easily gathered stuff. The easiest way to figure which branch to operate against is the "View CVS messages" in the project page.

GuillaumeDuveau’s picture

Hello,

For now we are still not using Glossary and unfortunately I'm too busy to roll a new patch...

asiby’s picture

Hello

What's the hold up with this subject? Has it been solved? Do you need help doing anything so that we get this patch integrated in the stable release?

I am asking all these questions because I have a internal policy that is "never patch a live production version of Drupal except for security updates". The reason for this is that the customer may lose some features if the patch is not part of the following release of the module and if someone accidentally update the module without applying the patch (if the patch is still compatible ... which is unlikely). That would be really annoying.

So when a patch such as this one is found to be really useful, we try to make sure that it will be part of the future releases.

So again, will this patch be part of future releases? How can I help in that regard?

Keep up the good work.

Cheers.

A. Siby

N4R4YAN’s picture

This is superneeded! Subscribing! :/
Simply everything that has an accent cannot be tagged because of the string append by editors :/

asiby’s picture

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

Closing due to lack of activity. Besides, the module no longer has any stable release for Drupal 6. Time for this version to retire.