Skip to content

Commit

Permalink
[BUGFIX] Process two-dimensional arrays from DefaultBrickGetterSequen…
Browse files Browse the repository at this point in the history
…ceToMultiselect
  • Loading branch information
80Quattro committed Jan 9, 2024
1 parent 9a594d4 commit d5442fe
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/IndexService/Worker/AbstractWorker.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,18 @@ abstract protected function doDeleteFromIndex(int $subObjectId, IndexableInterfa
protected function convertArray(array|string $data): array|string
{
if (is_array($data)) {
return WorkerInterface::MULTISELECT_DELIMITER . implode(WorkerInterface::MULTISELECT_DELIMITER, $data) . WorkerInterface::MULTISELECT_DELIMITER;
// One-dimensional array
if(count($data) == count($data, COUNT_RECURSIVE)) {
return WorkerInterface::MULTISELECT_DELIMITER . implode(WorkerInterface::MULTISELECT_DELIMITER, $data) . WorkerInterface::MULTISELECT_DELIMITER;
}

// Two-dimensional array
$string = WorkerInterface::MULTISELECT_DELIMITER;
foreach($data as $d) {
$string .= implode(WorkerInterface::MULTISELECT_DELIMITER, $d);
}
$string .= WorkerInterface::MULTISELECT_DELIMITER;
return $string;
}

return $data;
Expand Down

0 comments on commit d5442fe

Please sign in to comment.