diff --git a/components/ImportExportBundle/src/bundle/Controller/Admin/JobController.php b/components/ImportExportBundle/src/bundle/Controller/Admin/JobController.php index 380e27414..0d85b6e87 100644 --- a/components/ImportExportBundle/src/bundle/Controller/Admin/JobController.php +++ b/components/ImportExportBundle/src/bundle/Controller/Admin/JobController.php @@ -133,13 +133,16 @@ public function displayLogs(Job $job, RequestStack $requestStack): Response $request = $requestStack->getMainRequest(); $countsByLevel = $this->jobService->getJobLogsCountByLevel($job); - $formBuilder = $this->formFactory->createNamedBuilder('logs', FormType::class, null, ['method' => 'GET']); $formBuilder->add('level', ChoiceType::class, [ 'label' => 'job.logs.level', - 'choices' => array_flip($countsByLevel), - 'choice_label' => function ($choice, int $count, int $level) { - return sprintf('%s (%d)', Logger::getLevelName($level), $count); + 'choices' => array_flip([null => array_sum($countsByLevel)] + $countsByLevel), + 'choice_label' => function ($choice, int $count, $level) { + return sprintf( + '%s (%d)', + $level ? Logger::getLevelName((int) $level) : 'ALL', + $count + ); }, 'attr' => [ 'class' => 'ibexa-form-autosubmit', diff --git a/components/ImportExportBundle/src/lib/Item/ValueTransformer/Ibexa/TaxonomyEntryTransformer.php b/components/ImportExportBundle/src/lib/Item/ValueTransformer/Ibexa/TaxonomyEntryTransformer.php index f8281f41b..011da22e9 100644 --- a/components/ImportExportBundle/src/lib/Item/ValueTransformer/Ibexa/TaxonomyEntryTransformer.php +++ b/components/ImportExportBundle/src/lib/Item/ValueTransformer/Ibexa/TaxonomyEntryTransformer.php @@ -31,16 +31,17 @@ public function transform($value, array $options = []) return null; } $taxonomy = $options['taxonomy'] ?? null; - if (is_array($value)) { - $entries = []; - foreach ($value as $id) { - $entries[] = $this->loadTaxonomyEntry($id, $taxonomy); - } - return array_filter($entries); + if (is_scalar($value)) { + return $this->loadTaxonomyEntry($value, $taxonomy); + } + + $entries = []; + foreach ($value as $id) { + $entries[] = $this->loadTaxonomyEntry($id, $taxonomy); } - return $this->loadTaxonomyEntry($value, $taxonomy); + return array_filter($entries); } /**