From 80e69e5b5fc99671224f54c80609d78e6ee271da Mon Sep 17 00:00:00 2001 From: Andreas Granig Date: Tue, 11 Apr 2017 17:07:32 +0200 Subject: [PATCH] TT#14334 Fix showing customer name * If firstname or lastname is missing, avoid showing "null" in custom column renderer. Change-Id: I5e8e28e41d9c9379bc790a802048c9b820f70713 --- lib/NGCP/Panel/Controller/Customer.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/NGCP/Panel/Controller/Customer.pm b/lib/NGCP/Panel/Controller/Customer.pm index f89c06450f..afb1602c16 100644 --- a/lib/NGCP/Panel/Controller/Customer.pm +++ b/lib/NGCP/Panel/Controller/Customer.pm @@ -62,7 +62,7 @@ sub list_customer :Chained('/') :PathPart('customer') :CaptureArgs(0) { { name => "contact.email", search => 1, title => $c->loc("Contact Email") }, { name => "contact.firstname", search => 1, title => '' }, { name => "contact.lastname", search => 1, title => $c->loc("Name"), - custom_renderer => 'function ( data, type, full ) { return full.contact_firstname + " " + full.contact_lastname; }' }, + custom_renderer => 'function ( data, type, full ) { var sep = (full.contact_firstname && full.contact_lastname) ? " " : ""; return (full.contact_firstname || "") + sep + (full.contact_lastname || ""); }' }, { name => "billing_mappings_actual.billing_mappings.product.name", search => 1, title => $c->loc("Product") }, { name => "billing_mappings_actual.billing_mappings.billing_profile.name", search => 1, title => $c->loc("Billing Profile") }, { name => "status", search => 1, title => $c->loc("Status") },