From 13b2ec037860aac8bbd9e32c3a6df8218fd873fd Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Wed, 19 Oct 2022 14:37:34 +0000 Subject: [PATCH] Bug 19361: Fix advanced cataloging editor dropdowns Signed-off-by: Andrew Fuerste-Henry Signed-off-by: Katrin Fischer Signed-off-by: Tomas Cohen Arazi (cherry picked from commit fdc82e6c6dc0d9853e5950c0c07805fcc2a1e2ac) Signed-off-by: Matt Blenkinsop --- .../intranet-tmpl/prog/en/includes/cateditor-ui.inc | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) 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 c51ab8fb49..6df08dbef6 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/cateditor-ui.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/cateditor-ui.inc @@ -99,8 +99,8 @@ require( [ 'koha-backend', 'search', 'macros', 'marc-editor', 'marc-record', 'pr return $result[0]; }, postCreate: function() { - var value = defaultvalue; var widget = this; + var value = widget.text || defaultvalue; $.each( authvals, function() { if ( this.value == widget.text ) { @@ -112,9 +112,18 @@ require( [ 'koha-backend', 'search', 'macros', 'marc-editor', 'marc-record', 'pr $( '' ).appendTo( this.node ); var $node = $( this.node ).find( 'select' ); + var matched = false; $.each( authvals, function( undef, authval ) { - $node.append( '' ); + selected = ''; + if (authval.value == value){ + matched=true; + selected = ' selected="selected" '; + }; + $node.append( '' ); } ); + if( !matched ){ + $node.append( '' ); + } $node.val( this.text ); $node.change( $.proxy( function() { -- 2.39.5