Found Spell Checker Bug in 1.8? Fixed?

Found Spell Checker Bug in 1.8? Fixed?

by Jerry Brady -
Number of replies: 11
Mayt this message finds you in heath and happiness.

I was working on a spellchecker problem in Moodle 1.8 and discovered what could be a bug, or at least a problem that required a code change to resolve.

I was working on getting the aspell-driven spelling checker to work when at the final step the pop-up spellcheck tool would execute but wouldn't display any results.

I found a JavaScript error and resolved it (at least for Firefox) by changing
lin 58 of lib/speller/controls.html:

58c58
< var controlForm = getElementById('spellcheck');
---
> var controlForm = document.getElementById('spellcheck');

Because getElementById is not defined all by itself, it requires the document reference. This made things work for IE7 and FF2.

May this help someone else...
- Jerry
Average of ratings: -
In reply to Jerry Brady

Re: Found Spell Checker Bug in 1.8? Fixed?

by Richard Cory -
Hi Jerry and others

In 1.7, I had to add a line to the edit.html page in order to get it to recognize the utf languages.

In spellchecker.php, due to utf8 not being recognized- after line 40:
$current_lang = current_language();
I added
$current_lang = substr($current_lang,0,2);

to read:
$current_lang = current_language();
$current_lang = substr($current_lang,0,2);

=========

Since I upgraded to 1.8 it is broken. I did the same addition in the server-scripts/spellchecker.php file and now,when there is no error, nothing shows.

When there is a spelling error, the whole contents of the forum post shows, not just the misspelling.

=====

I need help with this one

RC


In reply to Richard Cory

Re: Found Spell Checker Bug in 1.8? Fixed?

by Larry Elchuck -
The spell checker does not work in my site, nor in this forum properly.

Try entering a sentance with a mis-spelt word to see.

Below is what I got when I did a spell check on the first part of this post:

" The spell checker does not work in my site, nor in this forum properly.<br /><br />Try entering a with a -spelt word to see.&ltbr />&ltbr />&ltbr />"


Attachment Picture_56.png
In reply to Larry Elchuck

Re: Found Spell Checker Bug in 1.8? Fixed?

by Jerry Brady -
Please try the change I suggested to controls.html above on line 58. That fixed the problem for me. During testing whomever committed the change must have been using a browser that permitted getElementById without a DOM reference.

I hope this helps.
In reply to Jerry Brady

Re: Found Spell Checker Bug in 1.8? Fixed?

by Larry Elchuck -
At first it made no difference for me, Jerry. I cleared my cache and quit my browser, relaunched and it works!

Thanks

larry
In reply to Jerry Brady

Re: Found Spell Checker Bug in 1.8? Fixed?

by Rob Johnson -
This fix worked for me. I was notified by a student that the spell checker was not working. This took care of it. smile
In reply to Jerry Brady

Re: Found Spell Checker Bug in 1.8? Fixed?

by Van Howell -

I made this change in the lib/speller/controls.html file I closed my browser and cleared the cache but I still have the problem with aspell.

I am using CentOS 5, PHP 5.1.6, ASpell 0.60, Moodle 1.8

I don't get any errors, Only the problem described above.  

In reply to Van Howell

Re: Found Spell Checker Bug in 1.8? Fixed?

by Van Howell -
I fixed it. I had to bump the http server.
In reply to Van Howell

Re: Found Spell Checker Bug in 1.8? Fixed?

by Simon Brock -
i have changed the line 58 to whats shown in the post above this fixed the spell check problem in ie however still does not work in ff, does anyone have this problem??

In reply to Simon Brock

Re: Found Spell Checker Bug in 1.8? Fixed?

by Rob Monk -
Don't worry about FF simon. Everyone uses IE anyway
In reply to Simon Brock

Re: Found Spell Checker Bug in 1.8? Fixed?

by Rob Johnson -
I can report that the fix worked in FF on my installation. Does the spell checker work for you here on Moodle.org? It was broken at the time this tread started, but has been fixed.