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 <david@davidnind.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
parent
1c3a35418e
commit
30d2ffd295
|
|
@ -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')
|
||||
|
|
|
|||
Loading…
Reference in New Issue