Need Speller Icon and Recognition of dictionary - On Linux

Need Speller Icon and Recognition of dictionary - On Linux

از W Page در
Number of replies: 13
Hello All!

Have there been any CVS changes since v1.5 Dev was released?

I have done updates on August 31, September 1, September 2 and tday. The version I continue to have is 2004083000

I am still,
  • Missing the Speller button on the HTML Editor Panel
  • Cannot access the english dictionary although the dictionary is installed.

I am on a Linux server.

Is there anyway I can get the speller icon to display and the dictionary to be recognized?

WP1
میانگین امتیازات: -
In reply to W Page

Re: Need Speller Icon and Recognition of dictionary - On Linux

از Will Muenchow در

Wow. Im a bit worried now. I have this same problem and it seems you had it last year and it has gone unanswered?  Moodle is showing the dictionaires in the editor settings administrative screens, but when I get to the editor within moodle I cannot find any type of spellcheck icon.  Any ideas?

In reply to Will Muenchow

Re: Need Speller Icon and Recognition of dictionary - On Linux

از Peter Cameron در
I've had the same problem.

Moodle knows where Aspell is, but when the HTML editor loads it doesn't. Hence no button.

I assume it looks in the wrong place. The path used to be in the main config file, but know its not. I can't find where the editor looks, nor where the info is now stored.
In reply to Peter Cameron

Re: Need Speller Icon and Recognition of dictionary - On Linux

از Daniel Mikšík در
تصویر Core developers تصویر Translators
I experienced the same behaviour today - it took several refreshes for the spell-check button to appear although everything was set (and set rightwink). Looks just like the editor remains in the browser cache maybe.

There are just three things being checked in the main editor script:


if (!empty($CFG->aspellpath) && file_exists($CFG->aspellpath) && !empty($CFG->editorspelling)) ...
,
i.e. if you set up a path to aspell, if you set it right, and if you selected that you want to use the spell-checking feature in the HTML editor.

So if you have all these set OK, there is no reason for the spell-check button not to appear. Try using another browser perhaps, or flushing the cache of your browser.

Was it of any help?
In reply to Daniel Mikšík

Re: Need Speller Icon and Recognition of dictionary - On Linux

از Will Muenchow در

HI Daniel!

First, thanks very much for responding!!! Really appreciate it! I believe all my settings to be correct. I have the aspell set to /usr/bin/aspell - Now if I were to misspell the directory and a q on the end of aspell, moodle complains with "Error, Check your aspell installation!". When I revert the directory back to /usr/bin/aspell the error goes away and I have the choice of

en
en_CA
en_CA-w-accents
en_GB
en_GB-w-accents
en_US
en_US_w-accents

I've chosen each of these with no luck.  I also have the editorspelling as "Yes". Also, all my editor icons are unchecked.

Any idea?

In reply to Will Muenchow

Re: Need Speller Icon and Recognition of dictionary - On Linux

از Daniel Mikšík در
تصویر Core developers تصویر Translators
Well, not really.thoughtful
Could you place the following line near the bottom of some of the Moodle files, let's say admin/index.php?

echo $CFG->aspellpath."<br />".file_exists($CFG->aspellpath)."<br />".$CFG->editorspelling;

If you see
/usr/bin/aspell
1
1
after refresh, then somebody else will have to help you, I'm afraid...
In reply to Daniel Mikšík

Re: Need Speller Icon and Recognition of dictionary - On Linux

از Will Muenchow در

I get this.

/usr/bin/aspell

1

Only one instance of 1, not two like yours. Does that make a difference?

In reply to Will Muenchow

Re: Need Speller Icon and Recognition of dictionary - On Linux

از Daniel Mikšík در
تصویر Core developers تصویر Translators
Yes, that's make a difference. It means that the PHP function file_exists is not able to locate the file /usr/bin/aspell. I don't know why it is so. The PHP Manual says this could be due to Safe Mode restrictions (further info).

At the Moodle admin page, the mechanism for checking the path to (and function of)
aspell is different, that's why everything seems OK there, and then there is no icon in the editor.

I'm not a Linux guy so I'm not able to say what you should do in order to get the
file_exists function to operate accordingly in you Moodle installation. What you can use as an immediate hack/test is to disable the file_exists check in the code of the editor and see whether the spell-checker will run without it, or not. If not, you have to find out how to tell the file_exists function that the file /usr/bin/aspell is at its place. It yes, you can leave it as it is, or pursue the same path as in the former case. لبخند

  1. Find the file lib/editor/htmlarea.php.
  2. Around line no. 150 find this bit of code:
    <?php if (!empty($CFG->aspellpath) && file_exists($CFG->aspellpath) && !empty($CFG->editorspelling)) {
    echo '"separator","spellcheck",';
    } ?>

  3. Delete the highlighted part, save the file and try to use the editor somewhere.

Tested just now: At my site, if I use the file_exists function in a place where the
Safe Mode restrictions apply, it returns FALSE, when used in a place with Safe Mode off, it returns TRUE.
In reply to Daniel Mikšík

Re: Need Speller Icon and Recognition of dictionary - On Linux

از Will Muenchow در
I went and deleted the && file_exists($CFG->aspellpath)
from the htmlarea.php file and went to the editor in the moodle and received the following error "Error [createSelect]: Can't find the requested dropdown definition" and also "FIXME: Unknown toolbar item: spellcheck" After I click ok on both of these popup windows the toolbar loads with all icons except the spellcheck.  It must be due to the file_exists fuction as you stated above.



In reply to Will Muenchow

Re: Need Speller Icon and Recognition of dictionary - On Linux

از Peter Cameron در
I'm having same problem.

For what its worth I copied this script from php org, (http://au2.php.net/file_exists), set it to may values, and ran it from Moodle root directory
______________________________________
<?php
$filename = '/usr/local/bin/aspell';      

if (file_exists($filename)) {
   echo "The file $filename exists";
} else {
   echo "The file $filename does not exist";
}
?>
______________________________________
It failed to recognise Aspell. Yet I can call Aspell from the same place via command line. The only other clue was that they say 'file_exists' would not work in 'safe mode' but my safe mode is 'off' according to Moodle.
In reply to Peter Cameron

Re: Need Speller Icon and Recognition of dictionary - On Linux

از Jaroslav Šeděnka در
There are a few things left to check:

1) if you have root access to the server, try 'su www-data' or 'su apache' and 'ls /usr/local/bin/aspell', this way you'll see if the filesystem permissions are correct

2) php.ini: make sure that 'open_basedir' is not set or is set to '/'.

Try to check these two things and then re-run the 'file_exists' script and hope it works.
In reply to Jaroslav Šeděnka

Re: Need Speller Icon and Recognition of dictionary - On Linux

از Peter Cameron در
Thanks, but these seem to be correct...

Permissions are:
-rwxr-xr-x 1 root root 821084 Jun 7 14:48 /usr/local/bin/aspell*

According to 'PHP info' in Moodle:
open_basedir/home/kvb/:/usr/lib/php:/usr/local/lib/php:/tmpno value

many thanks