Commit 73f5295f authored by Julien Minet's avatar Julien Minet

fix deprecations: pass Request in the Action function instead of using getRequest method

parent 80bef1f5
Pipeline #46335 failed with stages
in 5 minutes and 40 seconds
......@@ -42,7 +42,7 @@ class AccompanyingPeriodController extends Controller
'person' => $person));
}
public function createAction($person_id) {
public function createAction($person_id, Request $request) {
$person = $this->_getPerson($person_id);
$this->denyAccessUnlessGranted(PersonVoter::UPDATE, $person,
......@@ -57,8 +57,6 @@ class AccompanyingPeriodController extends Controller
$form = $this->createForm(AccompanyingPeriodType::class,
$accompanyingPeriod, array('period_action' => 'create'));
$request = $this->getRequest();
if ($request->getMethod() === 'POST') {
$form->handleRequest($request);
$errors = $this->_validatePerson($person);
......@@ -95,7 +93,7 @@ class AccompanyingPeriodController extends Controller
);
}
public function updateAction($person_id, $period_id){
public function updateAction($person_id, $period_id, Request $request){
$em = $this->getDoctrine()->getManager();
$accompanyingPeriod = $em->getRepository('ChillPersonBundle:AccompanyingPeriod')
......@@ -113,7 +111,6 @@ class AccompanyingPeriodController extends Controller
$form = $this->createForm(AccompanyingPeriodType::class,
$accompanyingPeriod, array('period_action' => 'update'));
$request = $this->getRequest();
if ($request->getMethod() === 'POST') {
$form->handleRequest($request);
......@@ -148,7 +145,7 @@ class AccompanyingPeriodController extends Controller
) );
}
public function closeAction($person_id) {
public function closeAction($person_id, Request $request) {
$person = $this->_getPerson($person_id);
$this->denyAccessUnlessGranted(PersonVoter::UPDATE, $person,
......@@ -171,8 +168,6 @@ class AccompanyingPeriodController extends Controller
'period_action' => 'close'
));
$request = $this->getRequest();
if ($request->getMethod() === 'POST') {
$form->handleRequest($request);
......@@ -244,14 +239,12 @@ class AccompanyingPeriodController extends Controller
}
public function openAction($person_id) {
public function openAction($person_id, Request $request) {
$person = $this->_getPerson($person_id);
$this->denyAccessUnlessGranted(PersonVoter::UPDATE, $person,
'You are not allowed to update this person');
$request = $this->getRequest();
//in case the person is already open
if ($person->isOpen()) {
$this->get('session')->getFlashBag()
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment