Bugzilla – Attachment 88617 Details for
Bug 16232
Edit as new (duplicate) doesn't work correctly with Rancor
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 16232: Fix edit as new in Rancor
Bug-16232-Fix-edit-as-new-in-Rancor.patch (text/plain), 3.97 KB, created by
Kyle M Hall (khall)
on 2019-04-24 12:20:24 UTC
(
hide
)
Description:
Bug 16232: Fix edit as new in Rancor
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2019-04-24 12:20:24 UTC
Size:
3.97 KB
patch
obsolete
>From 20e9d57d7b86cd6909fe58bff5d2046843b509f9 Mon Sep 17 00:00:00 2001 >From: Agustin Moyano <agustinmoyano@theke.io> >Date: Tue, 23 Apr 2019 00:50:49 +0000 >Subject: [PATCH] Bug 16232: Fix edit as new in Rancor > >When you edit a biblio as new, and you have enabled advanced editor, >current record was opened, and was overwritten when saved. This patch >effectively opens a new record based on the one selected. > >To test: >1) Enable "EnableAdvancedCatalogingEditor" preference >2) Go to cataloguing and click on advanced editor to save preference to the cookie >3) Search for an item in catalog >4) Click in "Edit as new (duplicate)" >5) Advanced editor should appear. >CHECK => browser url ends with #catalog/{original biblionumber} > => Title above toolbar is "Editing catalog record #{original biblionumber}" >6) Apply this patch >7) Repeat steps 3 to 5 >SUCCESS => browser url ends with #duplicate/{original biblionumber} > => Title above toolbar is "Editing duplicate record of #{original biblionumber}" >8) Save >SUCCESS => browser url ends with #catalog/{new biblionumber} > => Title above toolbar is "Editing catalog record #{new biblionumber}" >9) Sign off > >Sponsored-by: Carnegie > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > cataloguing/addbiblio.pl | 8 ++++++-- > .../prog/en/includes/cateditor-ui.inc | 15 +++++++++++++++ > 2 files changed, 21 insertions(+), 2 deletions(-) > >diff --git a/cataloguing/addbiblio.pl b/cataloguing/addbiblio.pl >index 246efa1ab4..6478bb2dfe 100755 >--- a/cataloguing/addbiblio.pl >+++ b/cataloguing/addbiblio.pl >@@ -737,11 +737,15 @@ if ($frameworkcode eq 'FA'){ > 'stickyduedate' => $fa_stickyduedate, > 'duedatespec' => $fa_duedatespec, > ); >-} elsif ( $op ne "delete" && C4::Context->preference('EnableAdvancedCatalogingEditor') && C4::Auth::haspermission(C4::Context->userenv->{id},{'editcatalogue'=>'advanced_editor'}) && $input->cookie( 'catalogue_editor_' . $loggedinuser ) eq 'advanced' && !$breedingid ) { >+} elsif ( $op ne "delete" && >+ C4::Context->preference('EnableAdvancedCatalogingEditor') && >+ C4::Auth::haspermission(C4::Context->userenv->{id},{'editcatalogue'=>'advanced_editor'}) && >+ $input->cookie( 'catalogue_editor_' . $loggedinuser ) eq 'advanced' && >+ !$breedingid ) { > # Only use the advanced editor for non-fast-cataloging. > # breedingid is not handled because those would only come off a Z39.50 > # search initiated by the basic editor. >- print $input->redirect( '/cgi-bin/koha/cataloguing/editor.pl' . ( $biblionumber ? ( '#catalog/' . $biblionumber ) : '' ) ); >+ print $input->redirect( '/cgi-bin/koha/cataloguing/editor.pl' . ( $biblionumber ? ( ($op eq 'duplicate'?'#duplicate/':'#catalog/') . $biblionumber ) : '' ) ); > exit; > } > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/cateditor-ui.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/cateditor-ui.inc >index 6c7f79f6dd..db6dc6629d 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/cateditor-ui.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/cateditor-ui.inc >@@ -234,6 +234,21 @@ require( [ 'koha-backend', 'search', 'macros', 'marc-editor', 'marc-record', 'pr > callback( record ); > }, > }, >+ 'duplicate': { >+ titleForRecord: _("Editing duplicate record of #{ID}"), >+ get: function( id, callback ) { >+ if ( !id ) return false; >+ >+ KohaBackend.GetRecord( id, callback ); >+ }, >+ save: function( id, record, done ) { >+ function finishCb( data ) { >+ done( { error: data.error, newRecord: data.marcxml && data.marcxml[0], newId: data.biblionumber && [ 'catalog', data.biblionumber ] } ); >+ } >+ >+ KohaBackend.CreateRecord( record, finishCb ); >+ } >+ }, > 'catalog': { > titleForRecord: _("Editing catalog record #{ID}"), > links: [ >-- >2.20.1 (Apple Git-117)
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 16232
:
88401
|
88617
|
88618