From 46840efc5409fb457a04ddb61c260a9dcd14e35d Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Fri, 7 Jun 2019 10:14:36 +0000 Subject: [PATCH] Bug 23045: Return record along with errors We don't seem to directly handle the errors in most cases, let's always return the record To test: 1 - Add some blank lines to editor, previous patch is okay with this 2 - Add a line with just 'e' or some other incomplete field 3 - Try to save 4 - Note JS leader error 5 - Apply this patch 6 - No errors Signed-off-by: Liz Rea --- koha-tmpl/intranet-tmpl/lib/koha/cateditor/text-marc.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/koha-tmpl/intranet-tmpl/lib/koha/cateditor/text-marc.js b/koha-tmpl/intranet-tmpl/lib/koha/cateditor/text-marc.js index 5846045bb7..b7623de805 100644 --- a/koha-tmpl/intranet-tmpl/lib/koha/cateditor/text-marc.js +++ b/koha-tmpl/intranet-tmpl/lib/koha/cateditor/text-marc.js @@ -95,7 +95,8 @@ define( [ 'marc-record' ], function( MARC ) { } } ); - return errors.length ? { errors: errors } : record; + if( errors.length ) { record.errors = errors; } + return record; } }; } ); -- 2.11.0