Commit 192a3776 authored by Jean-Philippe Metivier's avatar Jean-Philippe Metivier
Browse files

Correction du cas où le module n'est pas renseigné

parent 886e4db9
Loading
Loading
Loading
Loading
+1 −1
Changes for module/Formation/src/Formation/Controller/FormationController.php: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -64,7 +64,7 @@ class FormationController extends AbstractController
        if ($module !== null) $formation->setModule($module);

        $form = $this->getFormationForm();
        $form->setAttribute('action', $this->url()->fromRoute('formation/formation/ajouter', ['module' => $module->getId()], [], true));
        $form->setAttribute('action', $this->url()->fromRoute('formation/formation/ajouter', ['module' => ($module)?$module->getId():null], [], true));
        $form->bind($formation);

        $request = $this->getRequest();
+4
Changes for module/Formation/src/Formation/Entity/Db/Repository/ModuleRepository.php: 4 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -18,10 +18,14 @@ class ModuleRepository extends EntityRepository
     */
    public function getRequestedModule(AbstractActionController $controller, string $param = 'module') : ?Module
    {
        $module = null;
        $id = $controller->params()->fromRoute($param);
        /** @var Module|null $module */
        if ($id) {
            $module = $this->find($id);
        }
        return $module;

    }

    /**
+1 −2
Changes for module/Formation/src/Formation/Form/Formation/FormationForm.php: 1 added line, 2 removed lines.
Original line number Diff line number Diff line
@@ -32,7 +32,6 @@ class FormationForm extends Form {
        return $this;
    }


    public function init()
    {
        //titre
@@ -200,7 +199,7 @@ class FormationForm extends Form {
            'libelle'       => [ 'required' => true, ],
            'description'   => [ 'required' => false, ],
            'lien'          => [ 'required' => false, ],
            'module'        => [ 'required' => false, ],
            'module'        => [ 'required' => true, ],
            'site'          => [ 'required' => false, ],
            'responsable'   => [ 'required' => false, ],
            'modalite'      => [ 'required' => false, ],
−2
Changes for module/Formation/view/formation/formation/index.phtml: 0 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -3,7 +3,6 @@
/**
 * @see \Formation\Controller\FormationController::indexAction()
 * @var Formation[] $formations
 *
 * @var string[] $filtres
 * @var array $listings
 */
@@ -32,7 +31,6 @@ $canSupprimerFormation = $this->isAllowed(FormationPrivileges::getResourceId
    </a>
<?php endif; ?>


<table class="table table-condensed table-hover">
    <thead>
        <tr>