From 88257e42d8f531ca85129b7de409c87d891d7a4a Mon Sep 17 00:00:00 2001 From: Benjamin Ulrich <b.ulrich@adito.de> Date: Wed, 13 May 2020 08:07:15 +0000 Subject: [PATCH] [Projekt: Entwicklung - Neon][TicketNr.: 1054657][Person Index affectedIds retrurn [null]] --- .../recordcontainers/index/affectedIds.js | 6 ++++-- .../recordcontainers/index/affectedIds.js | 8 ++++---- process/IndexSearch_lib/process.js | 11 +++++++---- 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/entity/Organisation_entity/recordcontainers/index/affectedIds.js b/entity/Organisation_entity/recordcontainers/index/affectedIds.js index 12de7b2aec..a8b02566f9 100644 --- a/entity/Organisation_entity/recordcontainers/index/affectedIds.js +++ b/entity/Organisation_entity/recordcontainers/index/affectedIds.js @@ -41,8 +41,10 @@ switch (tableName) .arrayColumn(); }); break; + default: + res = []; //needed, because the Index is being rebuilt if nothing gets returned } -if (res) { result.object(res); -} + + diff --git a/entity/Person_entity/recordcontainers/index/affectedIds.js b/entity/Person_entity/recordcontainers/index/affectedIds.js index 24ea484ba1..1cbcfeeb68 100644 --- a/entity/Person_entity/recordcontainers/index/affectedIds.js +++ b/entity/Person_entity/recordcontainers/index/affectedIds.js @@ -47,9 +47,9 @@ switch (tableName) .arrayColumn(); }); break; + default: + res = []; //needed, because the Index is being rebuilt if nothing gets returned + break; } -if (res) { - result.object(res); -} - \ No newline at end of file + result.object(res); \ No newline at end of file diff --git a/process/IndexSearch_lib/process.js b/process/IndexSearch_lib/process.js index b39ce87ed0..532ec972fe 100644 --- a/process/IndexSearch_lib/process.js +++ b/process/IndexSearch_lib/process.js @@ -22,15 +22,18 @@ function IndexsearchUtils() {} */ IndexsearchUtils.getAffectedIdValues = function(fieldname, affectedInfoContainer, updateFn) { var affectedIds; - switch (affectedInfoContainer.action){ - case "I": - affectedIds = [affectedInfoContainer.newValues[affectedInfoContainer.columns.indexOf(fieldname)]]; + switch (affectedInfoContainer.action) + { + case "I": + affectedIds = affectedInfoContainer.newValues[affectedInfoContainer.columns.indexOf(fieldname)]; + affectedIds = affectedIds ? [affectedIds] : [] break; case "U": affectedIds = updateFn.call(null, affectedInfoContainer.id); break; case "D": - affectedIds = [affectedInfoContainer.oldValues[affectedInfoContainer.columns.indexOf(fieldname)]]; + affectedIds = affectedInfoContainer.oldValues[affectedInfoContainer.columns.indexOf(fieldname)]; + affectedIds = affectedIds ? [affectedIds] : [] break; } return affectedIds || []; -- GitLab