- add_opac_new( $title, $new, $lang, $expirationdate, $timestamp, $number );
- print $cgi->redirect("/cgi-bin/koha/tools/koha-news.pl");
+ if ($title) {
+ add_opac_new(
+ {
+ title => $title,
+ new => $new,
+ lang => $lang,
+ expirationdate => $expirationdate,
+ timestamp => $timestamp,
+ number => $number,
+ branchcode => $branchcode,
+ borrowernumber => $borrowernumber,
+ }
+ );
+ print $cgi->redirect("/cgi-bin/koha/tools/koha-news.pl");
+ }
+ else {
+ print $cgi->redirect("/cgi-bin/koha/tools/koha-news.pl?error_message=title_missing");
+ }