diff --git a/Services/UserService.php b/Services/UserService.php index af25337bd..cd964e6f4 100644 --- a/Services/UserService.php +++ b/Services/UserService.php @@ -37,9 +37,14 @@ public function getCustomFieldTemplateCustomer() $request = $this->requestStack->getCurrentRequest(); //get the ticket $ticket = $this->entityManager->getRepository('UVDeskCoreFrameworkBundle:Ticket')->findOneById($request->attributes->get('id')); + $getCustomerCustomFieldSnippet = $this->container->get('custom.field.service')->getCustomerCustomFieldSnippet($ticket); - return $this->twig->render('@_uvdesk_extension_uvdesk_form_component/widgets/CustomFields/customFieldSnippetCustomer.html.twig', - $this->container->get('custom.field.service')->getCustomerCustomFieldSnippet($ticket)); + if (sizeof($getCustomerCustomFieldSnippet["ticketCustomFieldCollection"]) > 0 && sizeof($getCustomerCustomFieldSnippet["customFieldCollection"]) > 0 ) { + return $this->twig->render('@_uvdesk_extension_uvdesk_form_component/widgets/CustomFields/customFieldSnippetCustomer.html.twig', + $getCustomerCustomFieldSnippet); + } + + return ; } public function isGranted($role) {