Closed (duplicate)
Project:
Glossary
Version:
5.x-1.6
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
18 Dec 2007 at 18:59 UTC
Updated:
23 Jan 2008 at 13:05 UTC
Jump to comment: Most recent file
I installed the new module on a Cyrillic website. The alphabet list appears above the terms, but clicking on the characters does not take you to the corresponding letter. It just reloads the page and it is still scrolled to the top. It does not matter if it is set to a single term per page or to all terms in one page. The alphabet bar just does not work.
| Comment | File | Size | Author |
|---|---|---|---|
| #20 | glossary_module_1.5_UTF8_fixed.zip | 8.84 KB | Geko21-1 |
| #7 | glossary.module | 31.19 KB | nancydru |
| #5 | glossary.ppl_.patch | 2.16 KB | nancydru |
Comments
Comment #1
nancydruYou are correct, it has a misplaced quotation mark. At line 719, you should see:
Change the 3rd line to:
(Remove the quote after the word 'letter' and it should work fine.)
Comment #2
nancydruFix committed.
Comment #3
Geko21-1 commentedThanks. Now it works when the terms and definitions are all in one page. However, when it is set to "Show glossary across many smaller pages" and there is only a list of the glossary terms on the main glossary page, it doesn't work and behaves as before. When I click to any letter, all terms disappear and a blank page reloads.
Comment #4
nancydruWhy did you set this to "Won't fix?" I'll do my best to fix it.
My glossary vocabulary is relatively small (26 terms), but I'm not seeing a blank page. I will agree that it is probably not working correctly. On my subset pages, the terms descriptions are not shown - that definitely needs to be fixed.
Also, I'm wondering if maybe I should add an option to show only the letters that are used rather than all of them.
Comment #5
nancydruTry this patch, please.
Comment #6
Geko21-1 commentedI am so sorry. I didn't realize what "won't fix" means. I thought it means that the suggested changes will not fix the problem. Really, truly sorry :(
I can not apply the patch though. It returns:
Hunk #1 FAILED at 628.
Hunk #2 FAILED at 664.
Hunk #3 FAILED at 690.
3 out of 3 hunks FAILED
I'll keep trying to figure it out but it does not seem to work, but when I look at the patch file in a text editor it seems a little mixed up. I am not good at all in this though, so I may be mistaken.
Can you please post here a patched version of the module file and I will test it right away...
Comment #7
nancydruHmm, the patch applies fine to my system.
Comment #8
nancydruFix committed. Try 1.7, please.
Comment #9
Geko21-1 commentedNope... :( It doesn't work. And even "Show glossary across many smaller pages" stopped working entirely. Have a look here: http://upadesa.org/glossary
The alpha bar is not working, and it is set to "Show glossary across many smaller pages" now, which it doesn't do anymore.
Comment #10
nancydruIs Cyrillic a multi-byte character set? Have you had a look at http://drupal.org/node/48966? I honestly don't understand much of what's in there, but I guess I have to get busy and do some more research.
Comment #11
Geko21-1 commentedYes, I always add the following code
$firstletter = mb_strtolower(mb_substr($term->name,0,1, 'UTF-8'),'UTF-8');and only after adding it do the cyrillic letters show up. However I do not think that the real problem here comes from the UTF-8 encoding necessary, but I may be mistaken...Comment #12
nancydruI've been trying to understand everything in the other post. I'm sorry that I'm just not very well versed on translation issues.
If I included that code in the module, would it break anything, like English?
And there are other parts to it. Like do I need to change the "range" statement? I'm guessing it really is necessary to use the "drupal_" version just in case someone doesn't have the necessary PHP support.
Comment #13
Geko21-1 commentedNo, using UTF-8 will not break anything. In fact it will make it much easier for the international users.
About the "range" statement I can not be of help... I am not really into coding at all :( I tried to look at the code to see what is going wrong but I couldn't figure out most of the things, so I gave up. Let's hope that some other multylanguage coder will pass by and help...
Comment #14
nancydruWell, I can code, but I can't speak other languages (I have tried).
You can try your hand at a translation file.
Comment #15
Geko21-1 commentedOf course I would, but I don't think it will help with the issue of the alpha bar not working. And, the module doesn't even want to show the glossary across many smaller pages - something which was working one version ago, although the alpha bar was not working....
Comment #16
nancydruI'm trying to work on the alphabar problem and I'll be contacting some of those that I know work with translation stuff to see if they can help. That may very well be why the page-per-letter is not working for you (it works just fine for me - in English). I wonder if some of the other people who are using this in a different (but still Latin) language are having your problem.
Comment #17
gábor hojtsyI just did a quick read of the above on nancyw's request. Drupal has the drupal_substr() function, with which you can get the first UTF char from any string (or any substring obviously). (I don't know how the alphabet bar itself is formed, but since the alphabet differs per language, it should be a setting, if not).
Comment #18
Geko21-1 commentedIs there any hope of this getting fixed?
Comment #19
nancydruI am working on it. Please be patient; I am just volunteer labor.
Comment #20
Geko21-1 commentedA friend just did the fixes and now everything is working on our site. However this is based on the 1.5 version of the module, because this is the only version which is showing the glossary terms on one page without definitions as it should.
Here I attach the fixed module file which handles well UTF-8.
btw, the fixes were minimal - only a couple of lines changed and took about 10 minutes to figure out and implement.
Comment #21
nancydruThanks, Geko. I'll see if I can get it to apply to my latest code.
Comment #22
nancydruI think I now understand part of the confusion here. Page-per-letter does work, but I think we have different expectations. When you first go into the glossary listing, you will see all terms. If you then click on a letter, you will see only the terms that start with that letter (page-per-letter). I think this was changed some time ago because of another issue, but I don't recall specifically.
Do we need to revisit the definition of page-per-letter? Do we need a new setting to control this.
Comment #23
nancydruPlease try the latest 1.x-dev version.
See also http://drupal.org/node/48966
Comment #24
nancydruLet's move all the discussion into a single issue - the older one http://drupal.org/node/48966