Ver código fonte

Erreur 500 : Argument 1 passed to Symfony\Bundle\FrameworkBundle\Controller\AbstractController::redirect() must be of the type string, null given #293

develop
Guillaume Bourgeois 2 anos atrás
pai
commit
421e624e1a
1 arquivos alterados com 8 adições e 7 exclusões
  1. +8
    -7
      Controller/Merchant/SwitchMerchantController.php

+ 8
- 7
Controller/Merchant/SwitchMerchantController.php Ver arquivo

@@ -37,19 +37,20 @@ class SwitchMerchantController extends AbstractController
if ($context == 'admin') {
$url .= 'admin';
}
}

if(!$url) {
$url = $request->headers->get('referer');
}

if($url) {
return $this->redirect($url);
}
}

if ($url) {
return $this->redirect($url);
} else {
$this->addFlashTranslator('error', ActionDefinition::SWITCH_MERCHANT, 'Merchant');
return $this->redirect($request->headers->get('referer'));
}


$this->addFlashTranslator('error', ActionDefinition::SWITCH_MERCHANT, 'Merchant');
return $this->redirectToRoute('frontend_home');
}

}

Carregando…
Cancelar
Salvar