Error 500 Internal Server Error

POST https://crm.home-arnrso.com/idev_sav/idev_reclamation/ws_create_reclamation

Forwarded to ErrorController (fc5c09)

Exceptions

App\Entity\Reclamation::setQuotation(): Argument #1 ($quotation) must be of type string, array given, called in /app/src/Service/ReclamationService.php on line 389

Exception

TypeError

  1.     public function getQuotation(): ?string {
  2.         return $this->quotation;
  3.     }
  4.     public function setQuotation(string $quotation): static {
  5.         $this->quotation $quotation;
  6.         return $this;
  7.     }
Reclamation->setQuotation() in src/Service/ReclamationService.php (line 389)
  1.                 dump('[envoyerFichiers] Ã©criture quotation''legacy_files/'.$filepath.$datas['quotation']['filename']);
  2.                 $fs->write('legacy_files/'.$filepath.$datas['quotation']['filename'], $b64Content);
  3.                 $datas['quotation'] = $filepath.$datas['quotation']['filename'];
  4.             }
  5.             dump('[envoyerFichiers] quotation finale'$datas['quotation']);
  6.             $reclamation->setQuotation($datas['quotation']);
  7.         }
  8.         if (!empty($datas['invoice'])) {
  9.             if (is_array($datas['invoice']) && !empty($datas['invoice']['base64'])) {
  10.                 $b64Content base64_decode($datas['invoice']['base64']);
  11.                 dump('[envoyerFichiers] Ã©criture invoice''legacy_files/'.$filepath.$datas['invoice']['filename']);
ReclamationService->envoyerFichiers() in src/Service/ReclamationService.php (line 307)
  1.             if (isset($formData['client_comment'])) {
  2.                 $reclamation->setClientComment($formData['client_comment']);
  3.             }
  4.             // Upload et set des fichiers joints
  5.             $this->envoyerFichiers($reclamation$formData);
  6.         }
  7.         $reclamation->setModdate(new \DateTime());
  8.         if ($statutPrecedent) {
  9.             if ($reclamation->getStatus() != $statutPrecedent) {
ReclamationService->enregistrer() in legacy/application/modules/idev_sav/controllers/idev_reclamation.php (line 918)
  1.                                 'chassis_photos' => array_map(fn($p) => is_array($p) ? array_merge($p, ['base64' => substr($p['base64'] ?? ''030).'...']) : $p, (array)$datas['chassis_photos']),
  2.                                 'mileage_photos' => array_map(fn($p) => is_array($p) ? array_merge($p, ['base64' => substr($p['base64'] ?? ''030).'...']) : $p, (array)$datas['mileage_photos']),
  3.                                 'quotation' => is_array($datas['quotation']) ? array_merge($datas['quotation'], ['base64' => substr($datas['quotation']['base64'] ?? ''030).'...']) : $datas['quotation'],
  4.                                 'delivery_form' => is_array($datas['delivery_form']) ? array_merge($datas['delivery_form'], ['base64' => substr($datas['delivery_form']['base64'] ?? ''030).'...']) : $datas['delivery_form'],
  5.                             ]));
  6.                             $retour $reclamationService->enregistrer($datas);
  7.                             dump('[ws_create_reclamation] retour enregistrer'$retour);
  8.                             if ($datas['status'] === RECLAMATION_STATUS_RECEIVED) {
  9.                                 $reclamation $reclamationService->detail($retour['uid']);
  10.                                 $reclamationService->envoyerAuCommercial($reclamation);
  11.                             }
idev_reclamation->ws_create_reclamation() in legacy/application/core/MY_Controller.php (line 198)
  1.                         $method 'unallowed_action';
  2.                     }
  3.                 }
  4.             }
  5.             call_user_func_array(array($this$method), $params);
  6.         }
  7.     }
  8.     public function set_default_assets() {
  9.         $default_assets = array(
MY_Controller->_remap() in legacy/system/core/CodeIgniter.php (line 336)
  1.  * ------------------------------------------------------
  2.  */
  3.     // Is there a "remap" function? If so, we call it instead
  4.     if (method_exists($CI'_remap'))
  5.     {
  6.         $CI->_remap($methodarray_slice($URI->rsegments2));
  7.     }
  8.     else
  9.     {
  10.         // is_callable() returns TRUE on some versions of PHP 5 for private and protected
  11.         // methods, so we'll use this workaround for consistent behavior
require_once('/app/legacy/system/core/CodeIgniter.php') in legacy/index.php (line 232)
  1.  * --------------------------------------------------------------------
  2.  *
  3.  * And away we go...
  4.  *
  5.  */
  6. require_once BASEPATH.'core/CodeIgniter.php';
  7. /* End of file index.php */
  8. /* Location: ./index.php */
require('/app/legacy/index.php') in src/Controller/LegacyBridgeController.php (line 53)
  1.             'mail_port' => $_ENV['mail_port'] ?? getenv('mail_port'),
  2.         ];
  3.         $legacyIndex __DIR__.'/../../legacy/index.php';
  4.         chdir(dirname($legacyIndex));
  5.         require $legacyIndex;
  6.         $htmlCi ob_get_clean();
  7.         preg_match('@<h1 class="main-section-title">(?s:.+)<\/h1>@'$htmlCi$titre);
  8.         if (!empty($titre)) {
  9.             $titre trim(strip_tags($titre[0]));
in vendor/symfony/http-kernel/HttpKernel.php -> legacy_controller (line 183)
  1.         $this->dispatcher->dispatch($eventKernelEvents::CONTROLLER_ARGUMENTS);
  2.         $controller $event->getController();
  3.         $arguments $event->getArguments();
  4.         // call controller
  5.         $response $controller(...$arguments);
  6.         // view
  7.         if (!$response instanceof Response) {
  8.             $event = new ViewEvent($this$request$type$response$event);
  9.             $this->dispatcher->dispatch($eventKernelEvents::VIEW);
  1.         $request->headers->set('X-Php-Ob-Level', (string) ob_get_level());
  2.         $this->requestStack->push($request);
  3.         $response null;
  4.         try {
  5.             return $response $this->handleRaw($request$type);
  6.         } catch (\Throwable $e) {
  7.             if ($e instanceof \Error && !$this->handleAllThrowables) {
  8.                 throw $e;
  9.             }
  1.         $this->boot();
  2.         ++$this->requestStackSize;
  3.         $this->resetServices true;
  4.         try {
  5.             return $this->getHttpKernel()->handle($request$type$catch);
  6.         } finally {
  7.             --$this->requestStackSize;
  8.         }
  9.     }
  1.     ) {
  2.     }
  3.     public function run(): int
  4.     {
  5.         $response $this->kernel->handle($this->request);
  6.         if (Kernel::VERSION_ID >= 60400) {
  7.             $response->send(false);
  8.             if (\function_exists('fastcgi_finish_request') && !$this->debug) {
in vendor/autoload_runtime.php -> run (line 32)
  1. $app $app(...$args);
  2. exit(
  3.     $runtime
  4.         ->getRunner($app)
  5.         ->run()
  6. );
require_once('/app/vendor/autoload_runtime.php') in public/index.php (line 5)
  1. <?php
  2. use App\Kernel;
  3. require_once dirname(__DIR__).'/vendor/autoload_runtime.php';
  4. return fn(array $context) => new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);

Logs

Level Channel Message
INFO 17:34:53 request Matched route "_profiler".
{
    "route": "_profiler",
    "route_parameters": {
        "_route": "_profiler",
        "_controller": "web_profiler.controller.profiler::panelAction",
        "token": "latest"
    },
    "request_uri": "https://crm.home-arnrso.com/_profiler/latest?ip=216.73.216.191&type=request",
    "method": "GET"
}

Stack Trace

TypeError
TypeError:
App\Entity\Reclamation::setQuotation(): Argument #1 ($quotation) must be of type string, array given, called in /app/src/Service/ReclamationService.php on line 389

  at src/Entity/Reclamation.php:264
  at App\Entity\Reclamation->setQuotation()
     (src/Service/ReclamationService.php:389)
  at App\Service\ReclamationService->envoyerFichiers()
     (src/Service/ReclamationService.php:307)
  at App\Service\ReclamationService->enregistrer()
     (legacy/application/modules/idev_sav/controllers/idev_reclamation.php:918)
  at idev_reclamation->ws_create_reclamation()
     (legacy/application/core/MY_Controller.php:198)
  at MY_Controller->_remap()
     (legacy/system/core/CodeIgniter.php:336)
  at require_once('/app/legacy/system/core/CodeIgniter.php')
     (legacy/index.php:232)
  at require('/app/legacy/index.php')
     (src/Controller/LegacyBridgeController.php:53)
  at App\Controller\LegacyBridgeController->legacy_controller()
     (vendor/symfony/http-kernel/HttpKernel.php:183)
  at Symfony\Component\HttpKernel\HttpKernel->handleRaw()
     (vendor/symfony/http-kernel/HttpKernel.php:76)
  at Symfony\Component\HttpKernel\HttpKernel->handle()
     (vendor/symfony/http-kernel/Kernel.php:182)
  at Symfony\Component\HttpKernel\Kernel->handle()
     (vendor/symfony/runtime/Runner/Symfony/HttpKernelRunner.php:35)
  at Symfony\Component\Runtime\Runner\Symfony\HttpKernelRunner->run()
     (vendor/autoload_runtime.php:32)
  at require_once('/app/vendor/autoload_runtime.php')
     (public/index.php:5)