From ebaef7332dbf323d56d8b04aed1085ae84de360a Mon Sep 17 00:00:00 2001 From: "S.Listl" <S.Listl@SLISTL.aditosoftware.local> Date: Tue, 12 May 2020 15:28:16 +0200 Subject: [PATCH] ContextUtils.loadContentTitle optimized --- process/Context_lib/process.js | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/process/Context_lib/process.js b/process/Context_lib/process.js index c34bf0f914..9baeb09edf 100644 --- a/process/Context_lib/process.js +++ b/process/Context_lib/process.js @@ -161,24 +161,18 @@ ContextUtils.getContextConsumer = function(pContextId) ContextUtils.loadContentTitle = function(pEntity, pUid, pProvider) { if (!pUid) - { return ""; - } var conf = entities.createConfigForLoadingRows() - .entity(pEntity) - .uid(pUid) - .fields(["#CONTENTTITLE"]); + .entity(pEntity) + .uid(pUid) + .fields(["#CONTENTTITLE"]); if (pProvider) conf.provider(pProvider); - - if (entities.getRowCount(conf) > 0) - { - return entities.getRow(conf)["#CONTENTTITLE"]; - } - - return ""; + + var rows = entities.getRows(conf); + return rows.length === 1 ? rows[0]["#CONTENTTITLE"] : ""; } /** -- GitLab