Forums | Mahara Community

Support /
Spell checker


Wullie's profile picture
Posts: 252

14 August 2013, 22:18

Over the summer, I moved my live database from a postgresql database to a mysql one and had to dump the database and re-import into the new database. 

Eveything seemed to have gone well, but now or some reason, no matter what I type in the text box, my spell checker does not appear to work.

Is there anything I can investigate to see why it's not working? Is this possibly related to my summer change (I can't see how it can be, but just checking?

Anyone have any ideas?

Thanks

Aaron Wells's profile picture
Posts: 896

15 August 2013, 17:49

Hi Wullie,

You mean the TinyMCE spell checker? The way that works:

1. It checks for an "aspell" utility at $cfg->pathtoaspell, which defaults to /usr/bin/aspell. If it finds that, it uses it for the spellcheck

2. If it doesn't find that, it tries to use the GoogleSpell engine, which is based on a Google webservice

It appears that Google has discontinued the webservice that GoogleSpell was based on. I suspect your site must not have had a local copy of aspell, or it wasn't at /usr/bin/aspell, so it was using GoogleSpell instead, and that's the reason it's no longer working.

I've filed a bug to stop using the extinct GoogleSpell engine: https://bugs.launchpad.net/mahara/+bug/1212541 . In the meantime, you can try these options:

1. Install aspell on your web server, and set your $cfg->pathtoaspell to point at it

2. OR try one of the other spell checking engines that ships with the TinyMCE spellcheck plugin. There are 5 of them under htdocs/js/tinymce/plugins/spellchecker/classes, and you can configure them via htdocs/js/tinymce/plugins/spellchecker/config.php

3. OR you can try to remove the spellchecker button from your TinyMCE by editing lib/web.php. Look inside the smarty() function around line 136, where it declares a variable called $adv_buttons, and you'll see there the list of all the buttons in the TinyMCE instance. Remove the one called "spellchecker"

Thanks for helping me discover this bug! Wink

Cheers,

Aaron

Wullie's profile picture
Posts: 252

15 August 2013, 21:13

Nice of Google to just discontinue that without telling anyone Wink.

I'll have a look at getting aspell to work, but I'm not sure what I would need to change in the config file to get that to work. Can you give some help for that, or point me in the direction of a helpful website?

Thanks

A post by Account deleted was deleted

Aaron Wells's profile picture
Posts: 896

16 August 2013, 11:13

Hi Wullie,

In Google's defense, the API that TinyMCE was using was not a public API. It was a spellcheck API used by Chrome (or some other Google app), and the TinyMCE spellcheck devs reverse-engineered the protocol for it. So it turns out it was always on kinda shaky ground. Surprised

Regarding aspell: If you're running your site on Ubuntu, you just need to install the aspell utility like so:

sudo apt-get install aspell

Then you need to determine the path to the "aspell" command-line executable. One way of doing that would be with the "which" command, like so:

which aspell

If the path it returns is "/usr/bin/aspell", then you don't need to change any configuration in you Mahara site at all. Mahara will automatically detect the presence of aspell at that location and begin using it.

If your path is at a different location, you'll need to add this to your Mahara config.php:

$cfg->pathtoaspell = '/path/to/aspell';

With whatever the path to your aspell actually is.

If you're not hosting on Ubuntu, then the process to install the aspell utility may be different. It's a fairly standard Unix utility, so even if you're using a shared hosting service, it's possible your host provider may be able to tell you the path to it if you ask. Heck, I think there's even a Windows version of it. Smile

Cheers,

Aaron

Wullie's profile picture
Posts: 252

16 August 2013, 23:45

Aspell sorted (after having to fix apt-get, sure that's not my job as Learning Technologist, but hey-ho) and spellchecking now working.

Thanks for your help Aaron

Aaron Wells's profile picture
Posts: 896

19 August 2013, 10:32

Hi Wullie,

Glad to hear it! And thanks for helping me find out the problem with the GoogleSpell plugin. Wink

Cheers,

Aaron

anonymous profile picture
Account deleted
Posts: 14

12 November 2013, 1:06

Hy Aaron, Hy Wullie,

I have a similar problem with the spellchecker plugin.

I recieve no error but I only get the message, that no misspelling's are found.(..and I produced ugly error's for sure Wink )

I installed aspell to my host and tried also with the config line (path to aspell) in the config.php but that doesn't work at all. (-> No missspellings found!)

Is there anything I have to configure before aspell start to work?

 

Thanks a lot,

Christian

Aaron Wells's profile picture
Posts: 896

12 November 2013, 14:57

Hi Christian,

No, there shouldn't be any other setup necessary. If you've got $cfg->pathtoaspell set up, and the aspell file it points at exists and has the executable flag set, then Mahara will attempt to use that for the TinyMCE spellchecker.

See the file htdocs/js/tinymce/plugins/spellchecker/config.php for where it all happens. Hm, it would appear you also need access to the /tmp/ directory, so that's another thing that could be a possible problem.

Cheers,

Aaron

9 results