related flag missing bug fix in materio_flag module
This commit is contained in:
parent
b2fe1cc963
commit
2e57fbfee6
|
@ -65,7 +65,9 @@ class MaterioFlagController extends ControllerBase {
|
||||||
|
|
||||||
$data = [];
|
$data = [];
|
||||||
foreach ($colls as $id => $collection) {
|
foreach ($colls as $id => $collection) {
|
||||||
$flag_id = $collection->getRelatedFlag()->id();
|
$relatedflag = $collection->getRelatedFlag();
|
||||||
|
if ($relatedflag) {
|
||||||
|
$flag_id = $relatedflag->id();
|
||||||
|
|
||||||
// get the items
|
// get the items
|
||||||
$itemsids = $this->flagListsService->getFlagListItemIds($flag_id,$id);
|
$itemsids = $this->flagListsService->getFlagListItemIds($flag_id,$id);
|
||||||
|
@ -91,6 +93,14 @@ class MaterioFlagController extends ControllerBase {
|
||||||
"items" => $items
|
"items" => $items
|
||||||
// "items_uuids" => $items_uuids
|
// "items_uuids" => $items_uuids
|
||||||
);
|
);
|
||||||
|
} else {
|
||||||
|
\Drupal::logger('materio_flag')->notice('%colname (%colid): Collection\'s Related flag does not exists.',
|
||||||
|
[
|
||||||
|
'%colid' => $collection->id(),
|
||||||
|
'%colname' => $collection->getName()
|
||||||
|
]);
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return new JsonResponse($data);
|
return new JsonResponse($data);
|
||||||
|
|
Loading…
Reference in New Issue