Fixed: [social issue][admin] do not remove the parent when editing a social issue

https://gitlab.com/Chill-Projet/chill-bundles/-/issues/46
This commit is contained in:
2023-01-13 16:41:45 +01:00
parent 6bba6f68b3
commit b2dec3e587
3 changed files with 43 additions and 14 deletions

View File

@@ -13,10 +13,25 @@ namespace Chill\PersonBundle\Controller\SocialWork;
use Chill\MainBundle\CRUD\Controller\CRUDController;
use Chill\MainBundle\Pagination\PaginatorInterface;
use LogicException;
use Symfony\Component\Form\FormInterface;
use Symfony\Component\HttpFoundation\Request;
class SocialIssueController extends CRUDController
{
protected function createFormFor(string $action, $entity, ?string $formClass = null, array $formOptions = []): FormInterface
{
if ('new' === $action) {
return parent::createFormFor($action, $entity, $formClass, ['step' => 'create']);
}
if ('edit' === $action) {
return parent::createFormFor($action, $entity, $formClass, ['step' => 'edit']);
}
throw new LogicException('action is not supported: ' . $action);
}
protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator)
{
$query->addOrderBy('e.ordering', 'ASC');