From 640678b3ae5817cee436daa7d769defa200dabc3 Mon Sep 17 00:00:00 2001 From: Aleisha Amohia Date: Sun, 25 Oct 2020 16:35:50 +1300 Subject: [PATCH] Bug 23111: (follow-up) set default framework on advanced editor This patch ensures the advanced editor considers the default biblio framework. Also fixing bug in atomic update --- koha-tmpl/intranet-tmpl/lib/koha/cateditor/marc-editor.js | 7 ++++++- koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/editor.tt | 6 +++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/lib/koha/cateditor/marc-editor.js b/koha-tmpl/intranet-tmpl/lib/koha/cateditor/marc-editor.js index 6d90176e0a1..cec64b67d89 100644 --- a/koha-tmpl/intranet-tmpl/lib/koha/cateditor/marc-editor.js +++ b/koha-tmpl/intranet-tmpl/lib/koha/cateditor/marc-editor.js @@ -686,8 +686,13 @@ define( [ 'marc-record', 'koha-backend', 'preferences', 'text-marc', 'widget' ], displayRecord: function( record ) { this.cm.setValue( TextMARC.RecordToText(record) ); this.modified = false; + var fwcode = typeof record.frameworkcode !== 'undefined' ? record.frameworkcode : ''; + var defaultfw = $("a[data-default='Y']").data('frameworkcode'); + if ( typeof record.frameworkcode === 'undefined' && defaultfw ){ + fwcode = defaultfw; + } this.setFrameworkCode( - typeof record.frameworkcode !== 'undefined' ? record.frameworkcode : '', + fwcode, false, function ( error ) { if ( typeof error !== 'undefined' ) { diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/editor.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/editor.tt index ba6b88b95bc..c3dcd69120f 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/editor.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/editor.tt @@ -70,7 +70,11 @@ [% FOREACH framework IN frameworks %]
  • - + [% IF framework.is_default %] + + [% ELSE %] + + [% END %]   [% framework.frameworktext | html %] -- 2.11.0