Bugzilla – Attachment 135792 Details for
Bug 30904
(bug 24387 follow-up) Modifying library in news (additional contents) causes inconsistencies
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[ALTERNATIVE-PATCH] Bug 30904: (bug 24387 follow-up) Fix library modification of additional contents
Bug-30904-bug-24387-follow-up-Fix-library-modifica.patch (text/plain), 3.15 KB, created by
Jonathan Druart
on 2022-06-08 09:57:55 UTC
(
hide
)
Description:
[ALTERNATIVE-PATCH] Bug 30904: (bug 24387 follow-up) Fix library modification of additional contents
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2022-06-08 09:57:55 UTC
Size:
3.15 KB
patch
obsolete
>From ff80622b8694e720cb26c2fca61fd8be8d9d5659 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 8 Jun 2022 11:56:30 +0200 >Subject: [PATCH] Bug 30904: (bug 24387 follow-up) Fix library modification of > additional contents > >Modifying an existing element of additional content (News) by changing >the library causes a duplication of the entry on the Additional contents >(News) list. A subsequent attempt of deleting one of the entries results >in deleting both of them. This is due to the fact that after >the unwanted duplication all the entries share the same >additional_contents.code. > >Test plan >========= > >1. Create a piece of news under Tools > News. >2. After having saved it make a modification by changing the library. > It should result in two rows in the table. >3. Delete one of the lines with Delete button. Both lines will > disappear. >4. Apply the patch. >5. Repeat the steps 1 and 2. Only the one (the modified) entry should be > present in the table. >--- > .../prog/en/modules/tools/additional-contents.tt | 1 + > tools/additional-contents.pl | 5 ++++- > 2 files changed, 5 insertions(+), 1 deletion(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/additional-contents.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/additional-contents.tt >index 5b1ea8a746a..05f315b81e2 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/additional-contents.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/additional-contents.tt >@@ -183,6 +183,7 @@ > <input type="hidden" name="op" value="add_validate" /> > <input type="hidden" name="category" value="[% category | html %]" /> > <input type="hidden" name="code" value="[% additional_content.code | html %]" /> >+ <input type="hidden" name="idnew" value="[% additional_content.idnew | html %]" /> > <fieldset class="rows"> > <ol> > <li> >diff --git a/tools/additional-contents.pl b/tools/additional-contents.pl >index cead55e9a1f..c179cac7ef1 100755 >--- a/tools/additional-contents.pl >+++ b/tools/additional-contents.pl >@@ -82,6 +82,7 @@ elsif ( $op eq 'add_validate' ) { > my $location = $cgi->param('location'); > my $code = $cgi->param('code'); > my $branchcode = $cgi->param('branchcode') || undef; >+ my $idnew = $cgi->param('idnew'); > > my @lang = $cgi->multi_param('lang'); > >@@ -92,6 +93,8 @@ elsif ( $op eq 'add_validate' ) { > my $published_on = dt_from_string( scalar $cgi->param('published_on') ); > my $number = $cgi->param('number'); > >+ my $original_default = $idnew ? Koha::AdditionalContents->find($idnew) : undef; >+ > my $success = 1; > for my $lang ( sort {$a ne 'default'} @lang ) { # Process 'default' first > my $title = $cgi->param( 'title_' . $lang ); >@@ -100,7 +103,7 @@ elsif ( $op eq 'add_validate' ) { > { > category => $category, > code => $code, >- branchcode => $branchcode, >+ branchcode => $original_default ? $original_default->branchcode : $branchcode, > lang => $lang, > } > ); >-- >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 30904
:
135701
|
135792
|
135849
|
135965