|
Lines 104-109
elsif ( $op eq 'add_validate' ) {
Link Here
|
| 104 |
for my $lang ( sort {$a ne 'default'} @lang ) { # Process 'default' first |
104 |
for my $lang ( sort {$a ne 'default'} @lang ) { # Process 'default' first |
| 105 |
my $title = $cgi->param( 'title_' . $lang ); |
105 |
my $title = $cgi->param( 'title_' . $lang ); |
| 106 |
my $content = $cgi->param( 'content_' . $lang ); |
106 |
my $content = $cgi->param( 'content_' . $lang ); |
|
|
107 |
# Force a default record |
| 108 |
$content ||= '<!-- no_content -->' if $lang eq 'default'; |
| 109 |
|
| 107 |
my $additional_content = Koha::AdditionalContents->find( |
110 |
my $additional_content = Koha::AdditionalContents->find( |
| 108 |
{ |
111 |
{ |
| 109 |
category => $category, |
112 |
category => $category, |
|
Lines 113-119
elsif ( $op eq 'add_validate' ) {
Link Here
|
| 113 |
} |
116 |
} |
| 114 |
); |
117 |
); |
| 115 |
# Delete if title or content is empty |
118 |
# Delete if title or content is empty |
| 116 |
unless ( $title and $content ) { |
119 |
if( $lang ne 'default' && !$title && !$content ) { |
| 117 |
if ( $additional_content ) { |
120 |
if ( $additional_content ) { |
| 118 |
eval { $additional_content->delete }; |
121 |
eval { $additional_content->delete }; |
| 119 |
unless ($@) { |
122 |
unless ($@) { |
| 120 |
- |
|
|