change order for title in stored object

This commit is contained in:
2022-05-27 22:32:06 +02:00
parent c9ea9112f1
commit d49859e474
2 changed files with 9 additions and 9 deletions

View File

@@ -41,6 +41,13 @@ class StoredObjectType extends AbstractType
public function buildForm(FormBuilderInterface $builder, array $options)
{
if (true === $options['has_title']) {
$builder
->add('title', TextType::class, [
'label' => 'Title',
]);
}
$builder
->add('filename', AsyncUploaderType::class)
->add('type', HiddenType::class)
@@ -65,13 +72,6 @@ class StoredObjectType extends AbstractType
[$this, 'transformObject'],
[$this, 'reverseTransformObject']
));
if ($options['has_title']) {
$builder
->add('title', TextType::class, [
'label' => 'Title',
]);
}
}
public function configureOptions(OptionsResolver $resolver)
@@ -81,7 +81,7 @@ class StoredObjectType extends AbstractType
$resolver
->setDefault('has_title', false)
->addAllowedValues('has_title', [true, false]);
->setAllowedTypes('has_title', ['bool']);
}
public function getBlockPrefix()