[Koha-patches] [PATCH] [3.0.x](bug #2040) This prevent users to post empty suggestions, and post the same suggestion twice.

Joe Atzberger joe.atzberger at liblime.com
Wed Jul 8 17:21:29 CEST 2009


> +    print $input->redirect('/cgi-bin/koha/opac-suggestions.pl');
>  }


Need to exit after redirect.  Otherwise the script might still take some
actions later, including printing output, and it is a waste of processing
anyway.  In fact, you can remove avoid all the variable setting lines in the
conditional if you know you are just going to redirect.

In general, Koha uses redirect far too often when it should be providing
real feedback to the user.  This is probably another such case.

Also, as a stylistic thing, you could accomplish your changes to
NewSuggestion in one line.  Instead of wrapping the whole thing in a
conditional, just do:

$title or return;

-- 
Joe Atzberger
LibLime - Open Source Library Solutions
-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/koha-patches/attachments/20090708/64423d68/attachment-0002.htm>


More information about the Koha-patches mailing list