Bugzilla – Attachment 139299 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.76 KB, created by
Kyle M Hall (khall)
on 2022-08-17 15:54:38 UTC
(
hide
)
Description:
Bug 29782: Fix handling records without title or content
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2022-08-17 15:54:38 UTC
Size:
1.76 KB
patch
obsolete
>From 2ad0212967a78362e0b279aca79bc0441e4364df 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> > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.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.30.2
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