exports: fix errors and depreciations

This commit is contained in:
Mathieu Jaumotte 2022-07-12 14:19:50 +02:00
parent e9fca1288a
commit 56bed12886

View File

@ -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,