Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fixed project category validation

  • Loading branch information...
commit af23c6b6f74bc06208dbbc8873c59cdb3b83121e 1 parent 1b66334
Geoffrey Bachelet ubermuda authored
Showing with 12 additions and 12 deletions.
  1. +12 −12 src/Marketplace/Form/ProjectType.php
24 src/Marketplace/Form/ProjectType.php
View
@@ -29,18 +29,18 @@ public function setDefaultOptions(OptionsResolverInterface $resolver)
'categories' => function (Options $options, $value) {
return array_merge(array('none' => 'No category'), $value);
},
- 'validation_constraint' => new Assert\Collection(array(
- 'fields' => array(
- 'name' => new Assert\NotBlank(),
- 'description' => new Assert\NotBlank(),
- // 'category' => new Assert\Choice(array(
- // 'choices' => function (Options $options, $value) {
- // return array_keys($options['categories']);
- // }
- // ))
- ),
- 'allowExtraFields' => true,
- ))
+ 'validation_constraint' => function(Options $options, $value) {
+ return new Assert\Collection(array(
+ 'fields' => array(
+ 'name' => new Assert\NotBlank(),
+ 'description' => new Assert\NotBlank(),
+ 'category' => new Assert\Choice(array(
+ 'choices' => array_keys($options['categories'])
+ ))
+ ),
+ 'allowExtraFields' => true,
+ ));
+ }
));
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.