Skip to content

Commit

Permalink
bug #5333 Make Collection fields not sortable (javiereguiluz)
Browse files Browse the repository at this point in the history
This PR was merged into the 4.x branch.

Discussion
----------

Make Collection fields not sortable

Fixes #4342.

Commits
-------

f6063b7 Make Collection fields not sortable
  • Loading branch information
javiereguiluz committed Jul 14, 2022
2 parents 660d1bd + f6063b7 commit e46f66c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Field/Configurator/CollectionConfigurator.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ public function configure(FieldDto $field, EntityDto $entityDto, AdminContext $c
$field->setFormTypeOption('entry_options.attr.data-ea-widget', 'ea-autocomplete');
}

// the contents of this field are a collection of other fields, so it cannot be sorted
$field->setSortable(false);

$field->setFormTypeOptionIfNotSet('allow_add', $field->getCustomOptions()->get(CollectionField::OPTION_ALLOW_ADD));
$field->setFormTypeOptionIfNotSet('allow_delete', $field->getCustomOptions()->get(CollectionField::OPTION_ALLOW_DELETE));
$field->setFormTypeOptionIfNotSet('by_reference', false);
Expand Down

0 comments on commit e46f66c

Please sign in to comment.