mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 23:23:51 +00:00
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:
@@ -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');
|
||||
|
Reference in New Issue
Block a user