Skip to content

Commit

Permalink
Bugfix/fix for sf3 incompatibel formtype properties (#67)
Browse files Browse the repository at this point in the history
* Added requirement

Added Symfony compatibility requirement in the composer.json

Affected file
modified:   composer.json

* Changed formfield option types

The used option types were incompatible with Symfony 3.

old -> new
------------
type -> entry_type
options -> options_type
property -> choice_label

Affected files:
modified:   Form/Type/ProfileAddressType.php
modified:   Form/Type/ProfileContactType.php
  • Loading branch information
Nathan Waelkens authored and alexander-schranz committed Nov 9, 2017
1 parent 6b5ec38 commit 1ea6105
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Form/Type/ProfileAddressType.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public function buildForm(FormBuilderInterface $builder, array $options)
EntityType::class,
[
'class' => Country::class,
'property' => function (Country $country) {
'choice_label' => function (Country $country) {
return Intl::getRegionBundle()->getCountryName($country->getCode());
},
]
Expand Down
8 changes: 4 additions & 4 deletions Form/Type/ProfileContactType.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,17 @@ public function buildForm(FormBuilderInterface $builder, array $options)
CollectionType::class,
[
'label' => false,
'type' => $options['contact_address_type'],
'options' => $options['contact_address_type_options'],
'entry_type' => $options['contact_address_type'],
'entry_options' => $options['contact_address_type_options'],
]
);
$builder->add(
'notes',
CollectionType::class,
[
'label' => false,
'type' => $options['note_type'],
'options' => $options['note_type_options'],
'entry_type' => $options['note_type'],
'entry_options' => $options['note_type_options'],
]
);
}
Expand Down
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"license": "MIT",
"require": {
"php": "^5.5 || ^7.0",
"symfony/symfony": "^2.8.7 || ^3.0",
"sulu/sulu": "^1.3 || dev-develop",
"beberlei/DoctrineExtensions": "^1.0"
},
Expand Down

0 comments on commit 1ea6105

Please sign in to comment.