Bugzilla – Attachment 115074 Details for
Bug 27308
Advanced editor should skip blank lines when inserting new fields
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 27308: Skip blank lines when inserting new
Bug-27308-Skip-blank-lines-when-inserting-new.patch (text/plain), 2.03 KB, created by
Martin Renvoize (ashimema)
on 2021-01-12 11:50:44 UTC
(
hide
)
Description:
Bug 27308: Skip blank lines when inserting new
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2021-01-12 11:50:44 UTC
Size:
2.03 KB
patch
obsolete
>From bcfe2991f483d10f338ece8fcd8e679386aec8b9 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Thu, 24 Dec 2020 13:35:28 +0000 >Subject: [PATCH] Bug 27308: Skip blank lines when inserting new >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >The intent of the macro insert new function is to add a new field at the correct numerical place in the record. If you have a blank line while editing, however, the new line will be inserted at the blank line, rather than checking the rest of the record. > >To test: >1 - Create a macro like > new 690=â¡aLOCAL SUBJECT >2 - Insert a blank line into your record somewhere before where the 690 should be inserted >3 - Run the macro >4 - Line is inserted before the blank line >5 - Apply patch >6 - Reload (ensure cache is cleared and JS files are reloaded) >7 - Remove the previously created field, but leave the blank >8 - Run the macro >9 - Field is created at correct position > >Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > koha-tmpl/intranet-tmpl/lib/koha/cateditor/marc-editor.js | 4 +++- > 1 file changed, 3 insertions(+), 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 fb0bac5d98..bd3d38a212 100644 >--- a/koha-tmpl/intranet-tmpl/lib/koha/cateditor/marc-editor.js >+++ b/koha-tmpl/intranet-tmpl/lib/koha/cateditor/marc-editor.js >@@ -812,7 +812,9 @@ define( [ 'marc-record', 'koha-backend', 'preferences', 'text-marc', 'widget' ], > createFieldOrdered: function( tag ) { > var line, contents; > >- for ( line = 0; (contents = this.cm.getLine(line)); line++ ) { >+ //for ( line = 0; (contents = this.cm.getLine(line)); line++ ) { >+ for ( line = 0; line <= this.cm.lastLine(); line++ ) { >+ contents = this.cm.getLine(line); > if ( contents && contents.substr(0, 3) > tag ) break; > } > >-- >2.20.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 27308
:
114698
|
114762
|
115074
|
115075
|
115093