Kunstmaan / KunstmaanBundlesCMS

An advanced yet user-friendly content management system, based on the full stack Symfony framework combined with a whole host of community bundles. It provides a full featured, multi-language CMS system with an innovative page and form assembling process, versioning, workflow, translation and media managers and much more.
https://kunstmaancms.be
MIT License
406 stars 188 forks source link

[AdminListBundle] ExportService expects an array #3449

Open jerome2710 opened 1 month ago

jerome2710 commented 1 month ago

We are trying to migrate our first project to Symfony 6.4 with Kunstmaan 7.1. However, we are facing issues in the ExportService:

src/Kunstmaan/AdminListBundle/Service/ExportService.php#L80

foreach ($iterator as $item) {
  if (\array_key_exists(0, $item)) {
    $itemObject = $item[0];
} else {
  $itemObject = $item;
}

\array_key_exists() expects $item to be an array, however it is directly our Entity of the current AdminList;

array_key_exists(): Argument #2 ($array) must be of type array, App\Entity\MyEntity given

For now, we have patched this into the following;

foreach ($iterator as $item) {
  if (\is_array($item) && \array_key_exists(0, $item)) {
    $itemObject = $item[0];
} else {
  $itemObject = $item;
}
acrobat commented 2 weeks ago

@jerome2710 can you send a PR to fix this please?

jerome2710 commented 1 week ago

@acrobat https://github.com/Kunstmaan/KunstmaanBundlesCMS/pull/3473