diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index 4f9e921ff..c1746d30a 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -1,5 +1,6 @@ 7.2.0 - Added server side spellchecker (Martin Kamerbeek / Procolix) + - change: made Text::Aspell optional, nullifying spellchecker if not present 7.1.2 - Fixed a bug that caused workflows to fail if collaboration systems and diff --git a/lib/WebGUI/Asset/RichEdit.pm b/lib/WebGUI/Asset/RichEdit.pm index cffeaa2ab..10a2f72f9 100644 --- a/lib/WebGUI/Asset/RichEdit.pm +++ b/lib/WebGUI/Asset/RichEdit.pm @@ -19,7 +19,7 @@ use WebGUI::Asset; use WebGUI::Form; use WebGUI::Utility; use WebGUI::International; -use Text::Aspell; +eval 'use Text::Aspell'; # Optional our @ISA = qw(WebGUI::Asset); diff --git a/lib/WebGUI/Operation/SpellCheck.pm b/lib/WebGUI/Operation/SpellCheck.pm index b90083f27..d1971e1ae 100644 --- a/lib/WebGUI/Operation/SpellCheck.pm +++ b/lib/WebGUI/Operation/SpellCheck.pm @@ -12,7 +12,8 @@ package WebGUI::Operation::SpellCheck; use strict; use Encode; -use Text::Aspell; +# Optional, but if unavailable, spell checking will have no effect. +eval 'use Text::Aspell'; use WebGUI::Utility; =head1 NAME @@ -40,6 +41,7 @@ An instanciated session object. sub _getSpeller { my ($baseDir, $userDir, $homeDir); my $session = shift; + return undef unless Text::Aspell->can('new'); my $speller = Text::Aspell->new; # Get language diff --git a/sbin/testEnvironment.pl b/sbin/testEnvironment.pl index 7930d8cee..ed20752c7 100644 --- a/sbin/testEnvironment.pl +++ b/sbin/testEnvironment.pl @@ -92,7 +92,7 @@ checkModule("URI::Escape","3.28"); checkModule("POSIX"); checkModule("List::Util"); checkModule("Color::Calc"); -checkModule("Text::Aspell"); +checkModule("Text::Aspell",0.01,2); ################################### # Checking WebGUI