Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

create a form with an empty name. #17

Closed
aitboudad opened this issue Jul 31, 2015 · 4 comments
Closed

create a form with an empty name. #17

aitboudad opened this issue Jul 31, 2015 · 4 comments

Comments

@aitboudad
Copy link

when I create a form without name JqueryValidationBundle produces 2 exceptions in:

I made a quick fix for that see my commit
https://github.com/aitboudad/JqueryValidationBundle/commit/da07b54201ff3b452c64e761e64f9970ed884724

$form = $this->get('form.factory')->createNamed('', new SimpleFormType());
boekkooi added a commit that referenced this issue Aug 2, 2015
@boekkooi
Copy link
Owner

boekkooi commented Aug 2, 2015

Thank you for reporting! The problem should be fixed now (if not please reopen the issue).

@aitboudad
Copy link
Author

@boekkooi There is still one issue in FormDataConstraintFinder.php#L41 for getPropertyPath call

@boekkooi
Copy link
Owner

boekkooi commented Aug 2, 2015

I just added the check but if you have the time could you provide me with the form + model that was able to get to that point to throw a exception?

@aitboudad
Copy link
Author

Just edit issue7Action with

 $form = $this->get('form.factory')->createNamed('', new Issue7\Type\RecourseType());
public function issue7Action(Request $request)
    {
        $resource = new Issue7\Model\Recourse();
        $resource->setContents(array(
            new Issue7\Model\Content(),
            new Issue7\Model\Content()
        ));
        $resource->setInvalidContents(array(
            new Issue7\Model\Content()
        ));

        $form = $this->get('form.factory')->createNamed('', new Issue7\Type\RecourseType());
        $form->setData($resource);
        $this->handleForm($request, $form);
        return $this->render('::form.html.twig', array('form' => $form->createView()));
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants