Skip to content

Commit

Permalink
Fix ChoiceConfigurator with enums
Browse files Browse the repository at this point in the history
Apply the solution provided by the reporter of #5641
  • Loading branch information
Uplink03 authored and Radu Cristescu committed Oct 2, 2023
1 parent a91ca47 commit 8774da3
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/Field/Configurator/ChoiceConfigurator.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,7 @@ public function configure(FieldDto $field, EntityDto $entityDto, AdminContext $c
if ($allChoicesAreEnums) {
$processedEnumChoices = [];
foreach ($choices as $choice) {
if ($choice instanceof \BackedEnum) {
$processedEnumChoices[$choice->name] = $choice->value;
} else {
$processedEnumChoices[$choice->name] = $choice->name;
}
$processedEnumChoices[$choice->name] = $choice;
}

$choices = $processedEnumChoices;
Expand Down

0 comments on commit 8774da3

Please sign in to comment.