瀏覽代碼

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

develop
Guillaume Bourgeois 1 年之前
父節點
當前提交
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');
}

}

Loading…
取消
儲存