Bugzilla – Attachment 139209 Details for
Bug 29782
Additional contents: Fix handling records without title or content
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29782: Fix handling records without title or content
Bug-29782-Fix-handling-records-without-title-or-co.patch (text/plain), 1.70 KB, created by
Caroline Cyr La Rose
on 2022-08-16 14:24:04 UTC
(
hide
)
Description:
Bug 29782: Fix handling records without title or content
Filename:
MIME Type:
Creator:
Caroline Cyr La Rose
Created:
2022-08-16 14:24:04 UTC
Size:
1.70 KB
patch
obsolete
>From 872df132e488c6758fc6ee79d037e92fe4631e92 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Tue, 16 Aug 2022 12:02:13 +0000 >Subject: [PATCH] Bug 29782: Fix handling records without title or content > >Test plan: >Save a new record with only a title in the non-default tab (english). >Check if you see it on the list. Edit. >Save a new record without title but only content in non-default lang. >Check if you see it. >Do the same 2 edits on the default tab only. Verify too. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com> >--- > tools/additional-contents.pl | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > >diff --git a/tools/additional-contents.pl b/tools/additional-contents.pl >index 3d165216ea..de36d5d8e6 100755 >--- a/tools/additional-contents.pl >+++ b/tools/additional-contents.pl >@@ -104,6 +104,9 @@ elsif ( $op eq 'add_validate' ) { > for my $lang ( sort {$a ne 'default'} @lang ) { # Process 'default' first > my $title = $cgi->param( 'title_' . $lang ); > my $content = $cgi->param( 'content_' . $lang ); >+ # Force a default record >+ $content ||= '<!-- no_content -->' if $lang eq 'default'; >+ > my $additional_content = Koha::AdditionalContents->find( > { > category => $category, >@@ -113,7 +116,7 @@ elsif ( $op eq 'add_validate' ) { > } > ); > # Delete if title or content is empty >- unless ( $title and $content ) { >+ if( $lang ne 'default' && !$title && !$content ) { > if ( $additional_content ) { > eval { $additional_content->delete }; > unless ($@) { >-- >2.25.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 29782
:
139179
|
139209
|
139299