Bugzilla – Attachment 79502 Details for
Bug 16424
Advanced editor reverts records back to Default framework
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 16424: Handle framework code properly also when adding a new record
Bug-16424-Handle-framework-code-properly-also-when.patch (text/plain), 3.10 KB, created by
Katrin Fischer
on 2018-09-27 13:15:42 UTC
(
hide
)
Description:
Bug 16424: Handle framework code properly also when adding a new record
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2018-09-27 13:15:42 UTC
Size:
3.10 KB
patch
obsolete
>From 2c318bcbc5395199a68f0925ab8c8d2db6a8ef4e Mon Sep 17 00:00:00 2001 >From: Ere Maijala <ere.maijala@helsinki.fi> >Date: Mon, 17 Sep 2018 01:06:12 +0300 >Subject: [PATCH] Bug 16424: Handle framework code properly also when adding a > new record > >Signed-off-by: Michal Denar <black23@gmail.com> > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >--- > koha-tmpl/intranet-tmpl/lib/koha/cateditor/koha-backend.js | 11 ++++++++--- > svc/new_bib | 3 ++- > 2 files changed, 10 insertions(+), 4 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/lib/koha/cateditor/koha-backend.js b/koha-tmpl/intranet-tmpl/lib/koha/cateditor/koha-backend.js >index 49bf383..10e9337 100644 >--- a/koha-tmpl/intranet-tmpl/lib/koha/cateditor/koha-backend.js >+++ b/koha-tmpl/intranet-tmpl/lib/koha/cateditor/koha-backend.js >@@ -127,16 +127,21 @@ define( [ '/cgi-bin/koha/svc/cataloguing/framework?frameworkcode=&callback=defin > }, > > CreateRecord: function( record, callback ) { >+ var frameworkcode = record.frameworkcode; > record = record.clone(); > _removeBiblionumberFields( record ); > > $.ajax( { > type: 'POST', >- url: '/cgi-bin/koha/svc/new_bib', >+ url: '/cgi-bin/koha/svc/new_bib?frameworkcode=' + encodeURIComponent(frameworkcode), > data: record.toXML(), > contentType: 'text/xml' > } ).done( function( data ) { >- callback( _fromXMLStruct( data ) ); >+ var record = _fromXMLStruct( data ); >+ if ( record.marcxml ) { >+ record.marcxml[0].frameworkcode = frameworkcode; >+ } >+ callback( record ); > } ).fail( function( data ) { > callback( { error: _('Could not save record') } ); > } ); >@@ -159,7 +164,7 @@ define( [ '/cgi-bin/koha/svc/cataloguing/framework?frameworkcode=&callback=defin > } > callback( record ); > } ).fail( function( data ) { >- callback( { data: { error: data } } ); >+ callback( { error: _('Could not save record') } ); > } ); > }, > >diff --git a/svc/new_bib b/svc/new_bib >index d53f405..32e6fb1 100755 >--- a/svc/new_bib >+++ b/svc/new_bib >@@ -50,6 +50,7 @@ sub add_bib { > > my $result = {}; > my $inxml = $query->param('POSTDATA'); >+ my $frameworkcode = $query->url_param('frameworkcode') // ''; > print $query->header(-type => 'text/xml', -charset => 'utf-8'); > > my $marcflavour = C4::Context->preference('marcflavour') || 'MARC21'; >@@ -73,7 +74,7 @@ sub add_bib { > foreach my $field ( $record->field($itemtag) ) { > $record->delete_field($field); > } >- my ( $biblionumber, $biblioitemnumber ) = AddBiblio( $record, '' ); >+ my ( $biblionumber, $biblioitemnumber ) = AddBiblio( $record, $frameworkcode ); > my $new_record = GetMarcBiblio({ biblionumber => $biblionumber }); > if ( $query->url_param('items') ) { > foreach my $field ( $fullrecord->field($itemtag) ) { >-- >2.1.4
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 16424
:
78977
|
78978
|
79009
|
79010
|
79011
|
79017
|
79022
|
79294
|
79295
|
79296
|
79297
|
79298
|
79499
|
79500
|
79501
| 79502 |
79503
|
79504
|
79621