HTML Logo by World Wide Web Consortium (www.w3.org). Click to learn more about our commitment to accessibility and standards.

Moving forward with Composr

ocPortal has been relaunched as Composr CMS, which is now in beta. ocPortal 9 will be superseded by Composr 10.

Head over to compo.sr for our new site, and to our migration roadmap. Existing ocPortal member accounts have been mirrored.


Spell checking?! How do you do it properly?

Login / Search

 [ Join | More ]
 Add topic 
Posted
Rating:
#102917 (In Topic #20155)
Avatar

Fan in action

I have enabled the spell checker but when you click on preview it produces an error log and it seems that I may not have it installed properly.

Any ideas?

Below is an example of the error...An error has occurred

PHP WARNING [2] pspell_check() [<a href='http://www.php.net/manual/en/function.pspell-check.php'>function.pspell-check.php</a>]: 0 is not a PSPELL result index in data/areaedit/plugins/SpellChecker/spell-check-logic.php on line 452 (version: 9.0.12, PHP version: 5.4.17, URL: /data/preview.php?page=cms_comcode_pages&type=_ed)

Here is the stack trace:

Below is a stack trace revealing the state the software was in when the error occurred. If this represents a bug in the unmodified software, you may want to check ocPortal website for a fix, and if there isn't one, report this as a bug. Please note that merely posting a stack trace is not sufficient for us to solve your problem; the stack trace is just an aid that presents us with additional information. We still need to know the error message, what you tried to do, how you tried to do it, version numbers, and any other appropriate information.
We apologise for this problem and if it's a bug we hope you will work with us so that we can fix it for you promptly.

File '/home/bristolm/public_html/sources/failure.php'
Line '839'
Function 'get_html_trace'
Args  
File '/home/bristolm/public_html/sources/global2.php'
Line '1,043'
Function '_fatal_exit'
Args

'PHP WARNING [2] pspell_check() [<a href=\'http://www.php.net/manual/en/function.pspell-check.php\'>function.pspell-check.php</a>]: 0 is not a PSPELL result index in data/areaedit/plugins/SpellChecker/spell-check-logic.php on line 452'

File '/home/bristolm/public_html/sources/failure.php'
Line '226'
Function 'fatal_exit'
Args

'PHP WARNING [2] pspell_check() [<a href=\'http://www.php.net/manual/en/function.pspell-check.php\'>function.pspell-check.php</a>]: 0 is not a PSPELL result index in data/areaedit/plugins/SpellChecker/spell-check-logic.php on line 452'

File '/home/bristolm/public_html/sources/global2.php'
Line '906'
Function '_ocportal_error_handler'
Args

'warning'

2

'pspell_check() [<a href=\'http://www.php.net/manual/en/function.pspell-check.php\'>function.pspell-check.php</a>]: 0 is not a PSPELL result index'

'data/areaedit/plugins/SpellChecker/spell-check-logic.php'

452

Function 'ocportal_error_handler'
Args ...
File '/home/bristolm/public_html/data/areaedit/plugins/SpellChecker/spell-check-logic.php'
Line '452'
Function 'pspell_check'
Args

0

'semihtml'

File '/home/bristolm/public_html/data/areaedit/plugins/SpellChecker/spell-check-logic.php'
Line '110'
Function 'aspell_check'
Args ...

true

File '/home/bristolm/public_html/sources/preview.php'
Line '174'
Function 'spellchecklogic'
Args ...

true

File '/home/bristolm/public_html/sources/misc_scripts.php'
Line '141'
Function 'build_preview'
Args

true

File '/home/bristolm/public_html/data/preview.php'
Line '37'
Function 'preview_script'
Args






Back to the top
 
Posted
Rating:
#102919
Avatar

Community saint

I am by no means an expert, but is the php_pspell extension enabled on your server?
Back to the top
 
Posted
Rating:
#102924
Avatar

Fan in action

Doh you are quite correct!
Back to the top
 
Posted
Rating:
#102926
Avatar

You do have pspell installed, but it is failing. Try this replacement for data/areaedit/plugins/SpellChecker/spell-check-logic.php.

Attachment
» Download: spell-check-logic.php (19 Kb, 110 downloads so far)


It should either:
  1. start working because it is now reverting to the 'en' spelling pack and you are using some other pack which is not installed (ocPortal uses 'en_GB' by default, as specified by the dictionary language string – which could well not be installed). I have no idea if this is really the cause, but it is a possibility because I examined PHP's source code and found our detection of missing spelling packs isn't going to work as pspell only complains about them missing later in the initialisation process than it should.
  2. it will provide a proper error message and the cause is either a corrupt aspell installation on your server (which the PHP pspell extension uses) or both missing 'en' and 'en_GB' packs for aspell.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#106062
Avatar

Fan in training

Correct  :)

I am a freelance writer, currently working as an admission essay writing help provider.
Back to the top
 
There are too many online users to list.
Control functions:

Quick reply   Contract

Your name:
Your message: