From d409517102bcfc09bfa5963f50fe007ecd6981f3 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 Signed-off-by: David Nind --- koha-tmpl/intranet-tmpl/lib/koha/cateditor/marc-editor.js | 7 ++++++- .../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 ea7fde2e70c..ddef608efed 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 1824673fc2b..94ff973a5e0 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/editor.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/editor.tt @@ -72,7 +72,11 @@ [% FOREACH framework IN frameworks %]
  • - + [% IF framework.is_default %] + + [% ELSE %] + + [% END %]   [% framework.frameworktext | html %] -- 2.30.2