Bugzilla – Attachment 168099 Details for
Bug 25387
Merging different authority types creates no warning
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 25387: Warn when merging different authority types
Bug-25387-Warn-when-merging-different-authority-ty.patch (text/plain), 6.12 KB, created by
Nick Clemens (kidclamp)
on 2024-06-25 21:15:20 UTC
(
hide
)
Description:
Bug 25387: Warn when merging different authority types
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2024-06-25 21:15:20 UTC
Size:
6.12 KB
patch
obsolete
>From 7e74e0c6bcbd5d533c2d63e1ac37e18361b83735 Mon Sep 17 00:00:00 2001 >From: Marion Durand <marion.durand@biblibre.com> >Date: Wed, 6 Oct 2021 14:49:58 +0200 >Subject: [PATCH] Bug 25387: Warn when merging different authority types > >Merging two different authorities types can result in the loss of some >field. This patch adds a warning when merging different type of >authorities and add more display of authorities types during merge. > >To test: >1- Find two authorities you what to merge. Be sure that these >authorities have different type >2- Search for these authorities (be sure to have both results on the >results page) >3- For the first authority click on "Actions" then on "Merge", same for >the second one >4- Check that koha is asking you to choose a framework and that >authority types are not displayed >5- Choose a framework, then click on next >6- Check that the authority type is not displayed in the tabs and that >no warning appear >7- Apply the patch >8- Repeat step 1 to 3 again >9- Check that authority type is now displayed next to their ID >10- Repeate setp 5 again >11- Check that the authority types is now displayed in the tabs next to >their ID and that a warning appear > >Signed-off-by: David Nind <david@davidnind.com> >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >--- > authorities/merge.pl | 13 +++++++++++++ > .../intranet-tmpl/prog/en/includes/merge-record.inc | 3 ++- > .../prog/en/modules/authorities/merge.tt | 6 +++++- > 3 files changed, 20 insertions(+), 2 deletions(-) > >diff --git a/authorities/merge.pl b/authorities/merge.pl >index 2c82340468e..1e34e9f7be3 100755 >--- a/authorities/merge.pl >+++ b/authorities/merge.pl >@@ -156,6 +156,11 @@ else { > ($recordObj1, $recordObj2) = ($recordObj2, $recordObj1); > } > >+ # Getting frameworktext >+ my $frameworktext1 = Koha::Authority::Types->find( $recordObj1->authtypecode ); >+ my $frameworktext2 = Koha::Authority::Types->find( $recordObj2->authtypecode ); >+ my $frameworktextdestination = Koha::Authority::Types->find( $framework ); >+ > # Creating a loop for display > > my @records = ( >@@ -163,6 +168,7 @@ else { > recordid => $mergereference, > record => $recordObj1->record, > frameworkcode => $recordObj1->authtypecode, >+ frameworktext => $frameworktext1->authtypetext, > display => $recordObj1->createMergeHash($tagslib), > reference => 1, > }, >@@ -170,6 +176,7 @@ else { > recordid => $notreference, > record => $recordObj2->record, > frameworkcode => $recordObj2->authtypecode, >+ frameworktext => $frameworktext2->authtypetext, > display => $recordObj2->createMergeHash($tagslib), > }, > ); >@@ -180,6 +187,8 @@ else { > recordid2 => $notreference, > records => \@records, > framework => $framework, >+ frameworktext => $frameworktextdestination->authtypetext, >+ multipleauthtypes => ( $recordObj1->authtypecode ne $recordObj2->authtypecode ) ? 1 : 0, > ); > } > else { >@@ -194,10 +203,14 @@ else { > ); > if ( $recordObj1->authtypecode ne $recordObj2->authtypecode ) { > my $authority_types = Koha::Authority::Types->search( { authtypecode => { '!=' => '' } }, { order_by => ['authtypetext'] } ); >+ my $frameworktext1 = Koha::Authority::Types->find( $recordObj1->authtypecode ); >+ my $frameworktext2 = Koha::Authority::Types->find( $recordObj2->authtypecode ); > $template->param( > frameworkselect => $authority_types->unblessed, > frameworkcode1 => $recordObj1->authtypecode, > frameworkcode2 => $recordObj2->authtypecode, >+ frameworklabel1 => $frameworktext1->authtypetext, >+ frameworklabel2 => $frameworktext2->authtypetext, > ); > } > } >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/merge-record.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/merge-record.inc >index cdf3aefb544..d9a9db593dc 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/merge-record.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/merge-record.inc >@@ -51,6 +51,7 @@ > [% WRAPPER tab_item tabname= "tabrecord${record.recordid}" %] > [% record.recordid | html %] > [% IF record.reference %]<span>(ref)</span>[% END %] >+ <span>([% record.frameworktext | html %])</span> > [% END %] > [% END %] > [% END # /WRAPPER tabs_nav %] >@@ -69,7 +70,7 @@ > [% END %] > > [% BLOCK mergetarget %] >- <h2>Destination record</h2> >+ <h2>Destination record ([% authtypetext | html %])</h2> > <div id="result" class="page-section"> > <ul id="resultul"></ul> > </div> <!-- // #result --> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/merge.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/merge.tt >index 5c577c7556b..7ebfd2e448e 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/merge.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/merge.tt >@@ -109,7 +109,7 @@ div#result { margin-top: 1em; } > [% PROCESS mergesource sourcerecords=records %] > </div> > <div class="col-sm-6"> >-[% PROCESS mergetarget %] >+[% PROCESS mergetarget authtypetext=frameworktext %] > </div> > </div> > >@@ -118,6 +118,10 @@ div#result { margin-top: 1em; } > <input type="hidden" name="mergereference" value="[% mergereference | html %]" /> > <input type="hidden" name="frameworkcode" value="[% framework | html %]" /> > >+[% IF multipleauthtypes %] >+ <div class="dialog alert multiple-auth-types">Multiple authority types are used. There may be a data loss while merging.</div> >+[% END %] >+ > <fieldset class="action"> > <input type="hidden" name="op" value="cud-merge" /> > <input type="submit" class="btn btn-primary" value="Merge" /> >-- >2.39.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 25387
:
126415
|
126588
|
167226
|
167227
|
167258
| 168099 |
168100