Better error message when met with an unknown FAQ.

        Patch by foxfirefey. 

diffs (27 lines):

diff -r 7391417900df -r e40ce51049ae htdocs/support/faqbrowse.bml
--- a/htdocs/support/faqbrowse.bml      Thu Dec 24 17:25:15 2009 +0000
+++ b/htdocs/support/faqbrowse.bml      Sat Jan 02 03:17:33 2010 +0000
@@ -76,6 +76,11 @@ body<=
     if ( $faqidarg ) {
         # loading single faqid
         @faqs = ( LJ::Faq->load( $faqidarg, lang => $lang ) );
+        unless ( $faqs[0] ) {
+            $$title = BML::ml( '.error.title_nofaq', { faqid => $faqidarg } );
+            $$body = BML::ml( '.error.nofaq' );
+            return $_[1]->{'body'};
+        }
         $faqs[0]->render_in_place( { user => $user, url => $user_url } );
         $$title = $faqs[0]->question_html;
     } elsif ( $faqcatarg ) {
diff -r 7391417900df -r e40ce51049ae htdocs/support/faqbrowse.bml.text
--- a/htdocs/support/faqbrowse.bml.text Thu Dec 24 17:25:15 2009 +0000
+++ b/htdocs/support/faqbrowse.bml.text Sat Jan 02 03:17:33 2010 +0000
@@ -17,6 +17,8 @@
 
 .error.nofaq=The specified FAQ does not exist.
 
+.error.title_nofaq=Error retrieving FAQ [[faqid]]
+
 .lastupdated=Last Updated:
 
 .more=Read More
_______________________________________________
dw-changelog mailing list
[email protected]
http://lists.dwscoalition.org/mailman/listinfo/dw-changelog

Reply via email to