Browse Source

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 years ago
parent
commit
421e624e1a
1 changed files with 8 additions and 7 deletions
  1. +8
    -7
      Controller/Merchant/SwitchMerchantController.php

+ 8
- 7
Controller/Merchant/SwitchMerchantController.php View File

@@ -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');
}

}

Loading…
Cancel
Save