浏览代码

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 年前
父节点
当前提交
421e624e1a
共有 1 个文件被更改,包括 8 次插入7 次删除
  1. +8
    -7
      Controller/Merchant/SwitchMerchantController.php

+ 8
- 7
Controller/Merchant/SwitchMerchantController.php 查看文件

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

}

正在加载...
取消
保存