mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 07:03:49 +00:00
fix handling of DirectExportInterface
This commit is contained in:
@@ -72,17 +72,21 @@ final readonly class ExportFormHelper
|
||||
];
|
||||
}
|
||||
|
||||
$allowedFormatters = $this->exportManager
|
||||
->getFormattersByTypes($export->getAllowedFormattersTypes());
|
||||
$choices = [];
|
||||
foreach (array_keys(iterator_to_array($allowedFormatters)) as $alias) {
|
||||
$choices[] = $alias;
|
||||
}
|
||||
if ($export instanceof ExportInterface) {
|
||||
$allowedFormatters = $this->exportManager
|
||||
->getFormattersByTypes($export->getAllowedFormattersTypes());
|
||||
$choices = [];
|
||||
foreach (array_keys(iterator_to_array($allowedFormatters)) as $alias) {
|
||||
$choices[] = $alias;
|
||||
}
|
||||
|
||||
$data[ExportType::PICK_FORMATTER_KEY]['alias'] = match (count($choices)) {
|
||||
1 => $choices[0],
|
||||
default => null,
|
||||
};
|
||||
$data[ExportType::PICK_FORMATTER_KEY]['alias'] = match (count($choices)) {
|
||||
1 => $choices[0],
|
||||
default => null,
|
||||
};
|
||||
} else {
|
||||
unset($data[ExportType::PICK_FORMATTER_KEY]);
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
Reference in New Issue
Block a user