From 4bed47bb033be43937e6d5848184257b96fa6cd5 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 7 Jun 2023 11:07:36 +0200 Subject: [PATCH] Bug 33885: Prevent JS crash if creator does no longer exist JS error in the console was Uncaught TypeError: row.creator is null Signed-off-by: David Nind Signed-off-by: Tomas Cohen Arazi (cherry picked from commit 30d2ffd2953434eec112a403a0297e285fa4a76d) Signed-off-by: Fridolin Somers --- .../intranet-tmpl/prog/en/modules/acqui/orderreceive.tt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt index 4dca002ae4..749e68dc70 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt @@ -1156,7 +1156,11 @@ } $("#bookfund").select2({ width: '50%' }); $("#current-fund").html(FUNC_CUR.format(row.fund.budget.budget_period_description, row.fund.name)); - $("#creator").html([row.creator.surname, row.creator.firstname].filter(function(name){return name}).join(', ')+" ("+row.creator.patron_id+')') + if( row.creator ) { + $("#creator").html([row.creator.surname, row.creator.firstname].filter(function(name){return name}).join(', ')+" ("+row.creator.patron_id+')') + } else { + $("#creator").html(__("Account has been deleted")); + } $("#quantity_to_receive").val(row.quantity).prop('readonly', !row.subscription_id); $("#quantity").val( effective_create_items == 'cataloguing' ? row.quantity_received || 1 : row.quantity_received ) .prop('readonly', !row.subscription_id && effective_create_items == 'receiving') -- 2.39.5