]> sipb.mit.edu Git - ikiwiki.git/commitdiff
avoid crashing if Sort::Naturally is not installed
authorJoey Hess <joey@gnu.kitenet.net>
Thu, 19 Mar 2009 19:35:57 +0000 (15:35 -0400)
committerJoey Hess <joey@gnu.kitenet.net>
Thu, 19 Mar 2009 19:35:57 +0000 (15:35 -0400)
IkiWiki/Plugin/inline.pm

index a89e827c1c7ff2ecf2a877c7dd48d11e2105fbcd..218fd7515f6a15b866f2e0424f1fc5d2723a6a6f 100644 (file)
@@ -195,7 +195,10 @@ sub preprocess_inline (@) {
                @list=sort { pagetitle(basename($a)) cmp pagetitle(basename($b)) } @list;
        }
        elsif (exists $params{sort} && $params{sort} eq 'title_natural') {
-               require Sort::Naturally;
+               eval q{use Sort::Naturally};
+               if ($@) {
+                       error(gettext("Sort::Naturally needed for title_natural sort"));
+               }
                @list=sort { Sort::Naturally::ncmp(pagetitle(basename($a)), pagetitle(basename($b))) } @list;
        }
        elsif (exists $params{sort} && $params{sort} eq 'mtime') {