uvdesk / core-framework

UVDesk Community Helpdesk Core Framework Bundle providing the core essential functionalities and integration tools to easily integrate any other community helpdesk packages.
https://www.uvdesk.com
MIT License
60 stars 55 forks source link

Customer reply within account shows error 'Warning: array_map(): Argument #2 should be an array' #275

Closed laurentiu2 closed 4 years ago

laurentiu2 commented 4 years ago

Description
If a customer logs in and replies to a ticket, the message is sent but the application will display an error ''Warning: array_map(): Argument uvdesk/community-skeleton#2 should be an array' The reply is nevertheless sent and received.

How to reproduce
Create a ticket as customer, set up the password, log in and reply to a ticket.

Additional context
Stack trace shows this:

ErrorException: Warning: array_map(): Argument uvdesk/community-skeleton#2 should be an array

at vendor/uvdesk/core-framework/Workflow/Actions/Ticket/MailAgent.php:93 at Webkul\UVDesk\CoreFrameworkBundle\Workflow\Actions\Ticket\MailAgent::applyAction(object(srcApp_KernelDevDebugContainer), object(Ticket), array('for' => array('assignedAgent'), 'value' => '6'), null) (vendor/uvdesk/automation-bundle/EventListener/WorkflowListener.php:172) at Webkul\UVDesk\AutomationBundle\EventListener\WorkflowListener->applyWorkflowActions(object(Workflow), object(Ticket), null) (vendor/uvdesk/automation-bundle/EventListener/WorkflowListener.php:132) at Webkul\UVDesk\AutomationBundle\EventListener\WorkflowListener->executeWorkflow(object(GenericEvent), 'uvdesk.automation.workflow.execute', object(TraceableEventDispatcher)) (vendor/symfony/event-dispatcher/Debug/WrappedListener.php:126) at Symfony\Component\EventDispatcher\Debug\WrappedListener->__invoke(object(GenericEvent), 'uvdesk.automation.workflow.execute', object(TraceableEventDispatcher)) (vendor/symfony/event-dispatcher/EventDispatcher.php:260) at Symfony\Component\EventDispatcher\EventDispatcher->doDispatch(array(object(WrappedListener)), 'uvdesk.automation.workflow.execute', object(GenericEvent)) (vendor/symfony/event-dispatcher/EventDispatcher.php:235) at Symfony\Component\EventDispatcher\EventDispatcher->callListeners(array(object(WrappedListener)), 'uvdesk.automation.workflow.execute', object(GenericEvent)) (vendor/symfony/event-dispatcher/EventDispatcher.php:73) at Symfony\Component\EventDispatcher\EventDispatcher->dispatch(object(GenericEvent), 'uvdesk.automation.workflow.execute') (vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcher.php:168) at Symfony\Component\EventDispatcher\Debug\TraceableEventDispatcher->dispatch(object(GenericEvent), object(GenericEvent)) (vendor/uvdesk/support-center-bundle/Controller/Ticket.php:273) at Webkul\UVDesk\SupportCenterBundle\Controller\Ticket->saveReply(29, object(Request)) (vendor/symfony/http-kernel/HttpKernel.php:151) at Symfony\Component\HttpKernel\HttpKernel->handleRaw(object(Request), 1) (vendor/symfony/http-kernel/HttpKernel.php:68) at Symfony\Component\HttpKernel\HttpKernel->handle(object(Request), 1, true) (vendor/symfony/http-kernel/Kernel.php:198) at Symfony\Component\HttpKernel\Kernel->handle(object(Request)) (public/index.php:25)

papnoisanjeev commented 4 years ago

@laurentiu2

Thanks for notifying us for this bug we will fix this in our source code. You can remove this error by below given step.

  1. Open your project directory go to: vendor->uvdesk->core-framework->Workflow->Actions->Ticket->MailAgent.php
  2. Open MailAgent.php and go to line no 93
  3. Replace $entity->createdThread->getAttachments() by $entity->createdThread->getAttachments()->toArray()

And finally clear your project cache by following command: php bin/console c:c --env prod (for production environment) php bin/console c:c --env dev (for development environment)

laurentiu2 commented 4 years ago

Thanks alot!! And thanks for this great product!

Regards, Laurentiu