From 625483a8f2f615adfa4060705f5e4b406b8215c6 Mon Sep 17 00:00:00 2001 From: zadam Date: Sat, 15 Aug 2020 00:06:26 +0200 Subject: [PATCH] fixes --- src/public/app/services/bundle.js | 5 ++++- .../search/expressions/note_content_unprotected_fulltext.js | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/public/app/services/bundle.js b/src/public/app/services/bundle.js index 2935b9102..691562b69 100644 --- a/src/public/app/services/bundle.js +++ b/src/public/app/services/bundle.js @@ -1,6 +1,7 @@ import ScriptContext from "./script_context.js"; import server from "./server.js"; import toastService from "./toast.js"; +import treeCache from "./tree_cache.js"; async function getAndExecuteBundle(noteId, originEntity = null) { const bundle = await server.get('script/bundle/' + noteId); @@ -17,7 +18,9 @@ async function executeBundle(bundle, originEntity, $container) { }.call(apiContext)); } catch (e) { - toastService.showAndLogError(`Execution of ${bundle.noteId} failed with error: ${e.message}`); + const note = await treeCache.getNote(bundle.noteId); + + toastService.showAndLogError(`Execution of JS note "${note.title}" with ID ${bundle.noteId} failed with error: ${e.message}`); } } diff --git a/src/services/search/expressions/note_content_unprotected_fulltext.js b/src/services/search/expressions/note_content_unprotected_fulltext.js index ad11a8985..f30679d42 100644 --- a/src/services/search/expressions/note_content_unprotected_fulltext.js +++ b/src/services/search/expressions/note_content_unprotected_fulltext.js @@ -26,7 +26,7 @@ class NoteContentUnprotectedFulltextExp extends Expression { FROM notes JOIN note_contents USING (noteId) WHERE type IN ('text', 'code') AND isDeleted = 0 AND isProtected = 0`)) { - content = content.toLowerCase(); + content = content.toString().toLowerCase(); if (type === 'text' && mime === 'text/html') { content = striptags(content);