From 2837b6f60369d8de0790a84cb87e73bdcfddf7d4 Mon Sep 17 00:00:00 2001 From: Phil Ringnalda Date: Tue, 23 Feb 2021 20:24:43 -0800 Subject: [PATCH] Bug 27769: Advanced editor shouldn't break copying selected text with Ctrl+C When text is selected, the editor keyboard shortcut handler intentionally doesn't copy the line into the editor's clipboard, but also breaks the system clipboard copying it on Windows and Linux where Ctrl+C is copy. Returning CodeMirror.Pass should let the system copy when text is selected. Test plan: 1. Set the system preference EnableAdvancedCatalogingEditor to Enable 2. Cataloging - Advanced editor 3. Type some text in 245 subfield a 4. Select the text you typed, and type Ctrl+C 5. Verify that the entire line was not copied to the advanced editor's Clipboard div in the lower left corner of the page 6. In another app or in one of the Search inputs, Ctrl+V to paste from the system clipboard, verify that you pasted the text you selected in 245$a 7. Clear your text selection, but put the text insertion point into the 245 and type Ctrl+C, and verify that the entire line was copied into the editor's Clipboard div in the lower left --- koha-tmpl/intranet-tmpl/lib/koha/cateditor/marc-editor.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 6d90176e0a..3a320c844a 100644 --- a/koha-tmpl/intranet-tmpl/lib/koha/cateditor/marc-editor.js +++ b/koha-tmpl/intranet-tmpl/lib/koha/cateditor/marc-editor.js @@ -209,7 +209,7 @@ define( [ 'marc-record', 'koha-backend', 'preferences', 'text-marc', 'widget' ], _editorKeys[copy_line] = function( cm ) { // Copy line - if ( cm.somethingSelected() ) return true; + if ( cm.somethingSelected() ) return cm.Pass; var curLine = cm.getLine( cm.getCursor().line ); $("#clipboard").prepend(''); $("#clipboard option:first-child").prop('selected', true); -- 2.26.1