From 56bed12886f54718519499dc75a4fb24ab481226 Mon Sep 17 00:00:00 2001 From: Mathieu Jaumotte Date: Tue, 12 Jul 2022 14:19:50 +0200 Subject: [PATCH] exports: fix errors and depreciations --- .../ChillPersonBundle/Export/Export/ListPerson.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/Export/Export/ListPerson.php b/src/Bundle/ChillPersonBundle/Export/Export/ListPerson.php index 50b0f3d72..d3bc2728a 100644 --- a/src/Bundle/ChillPersonBundle/Export/Export/ListPerson.php +++ b/src/Bundle/ChillPersonBundle/Export/Export/ListPerson.php @@ -425,7 +425,9 @@ class ListPerson implements ExportElementValidatedInterface, ListInterface if ('_header' === $value) { return $this->translatableStringHelper->localize($cf->getName()); } - + if (null === $value) { + return ''; + } return $this->customFieldProvider ->getCustomFieldByType($cf->getType()) ->render(json_decode($value, true), $cf, 'csv'); @@ -434,6 +436,9 @@ class ListPerson implements ExportElementValidatedInterface, ListInterface if ($cfType instanceof CustomFieldChoice && $cfType->isMultiple($cf)) { return function ($value) use ($cf, $cfType, $key) { $slugChoice = $this->extractInfosFromSlug($key)['additionnalInfos']['choiceSlug']; + if (null === $value) { + return ''; + } $decoded = json_decode($value, true); if ('_header' === $value) { @@ -459,7 +464,7 @@ class ListPerson implements ExportElementValidatedInterface, ListInterface */ private function slugToDQL(string $slug, string $type = 'default', array $additionalInfos = []): string { - $uid = 'slug_' . uniqid('', true); + $uid = 'slug_' . uniqid('', false); $this->slugs[$uid] = [ 'slug' => $slug,