Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AdminListBundle] ExportService expects an array #3449

Open
jerome2710 opened this issue Oct 10, 2024 · 2 comments
Open

[AdminListBundle] ExportService expects an array #3449

jerome2710 opened this issue Oct 10, 2024 · 2 comments

Comments

@jerome2710
Copy link

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
Copy link
Member

acrobat commented Nov 11, 2024

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

@jerome2710
Copy link
Author

@acrobat #3473

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants