Skip to content

Commit

Permalink
Merge pull request #3403 from virtualize/fix-lead-generation-71
Browse files Browse the repository at this point in the history
[LeadGenerationBundle] fixed route and type handling
  • Loading branch information
acrobat authored Apr 20, 2024
2 parents 5580f18 + 4661515 commit 979d548
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,4 +104,18 @@ public function canAdd()
{
return true;
}

/**
* @param string|null $suffix
*
* @return string
*/
public function getPathByConvention($suffix = null)
{
if (null === $suffix || $suffix === '') {
return 'kunstmaanleadgenerationbundle_admin_popup_abstractpopup';
}

return sprintf('kunstmaanleadgenerationbundle_admin_popup_abstractpopup_%s', $suffix);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,9 @@ public function editAction(Request $request, $id): Response
#[Route(path: '/add', name: 'kunstmaanleadgenerationbundle_admin_popup_abstractpopup_add', methods: ['GET', 'POST'])]
public function addAction(Request $request): Response
{
$type = $request->query->get('type');
$type = $request->isMethod('post')
? $request->request->get('type')
: $request->query->get('type');

return parent::doAddAction($this->getAdminListConfigurator(), $type, $request);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ public function detailAction(Request $request, $popup)
#[Route(path: '/{popup}/add', requirements: ['popup' => '\d+'], name: 'kunstmaanleadgenerationbundle_admin_rule_abstractrule_add', methods: ['GET', 'POST'])]
public function addAction(Request $request, $popup): Response
{
$type = $request->query->get('type');
$type = $request->isMethod('post')
? $request->request->get('type')
: $request->query->get('type');

return parent::doAddAction($this->getAdminListConfigurator($popup), $type, $request);
}
Expand Down

0 comments on commit 979d548

Please sign in to comment.