From 4f7b9054e6c2b56ac7bb06d1e8d8ade89d11a2ff Mon Sep 17 00:00:00 2001 From: Vipin Shrivastava Date: Tue, 9 Nov 2021 18:24:05 +0530 Subject: [PATCH] chnages for custom filed show on customer side if not selected --- Services/UserService.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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) {