@@ -, +, @@ 1) Open up a record in Rancor with an itemtype besides the first in the list ('BK' in the sample itemtypes). 2) It will show "Book" instead of the correct itemtype. 3) Apply patch, reload the page. 4) The correct itemtype should now show. --- koha-tmpl/intranet-tmpl/prog/en/includes/cateditor-ui.inc | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) --- a/koha-tmpl/intranet-tmpl/prog/en/includes/cateditor-ui.inc +++ a/koha-tmpl/intranet-tmpl/prog/en/includes/cateditor-ui.inc @@ -77,12 +77,21 @@ require( [ 'koha-backend', 'search', 'macros', 'marc-editor', 'marc-record', 'pr return $result[0]; }, postCreate: function() { - this.setText( defaultvalue ); + var value = defaultvalue; + var widget = this; + + $.each( authvals, function() { + if ( this.value == widget.text ) { + value = this.value; + } + } ); + + this.setText( value ); $( '' ).appendTo( this.node ); var $node = $( this.node ).find( 'select' ); $.each( authvals, function( undef, authval ) { - $node.append( '' ); + $node.append( '' ); } ); $node.val( this.text ); --