diff --git a/html/modules/custom/ghi_blocks/src/Plugin/Block/Plan/PlanEntityLogframe.php b/html/modules/custom/ghi_blocks/src/Plugin/Block/Plan/PlanEntityLogframe.php index 197f4c6dd..b04f0ea2b 100644 --- a/html/modules/custom/ghi_blocks/src/Plugin/Block/Plan/PlanEntityLogframe.php +++ b/html/modules/custom/ghi_blocks/src/Plugin/Block/Plan/PlanEntityLogframe.php @@ -571,9 +571,9 @@ private function getPlanEntities($entity_ref_code = NULL) { /** @var \Drupal\ghi_plans\Plugin\EndpointQuery\EntityQuery $query */ $query = $this->getQueryHandler('entity'); $plan_data = $query->getEntity('plan', $context_object->getSourceId()); - return [ + return $plan_data ? [ $plan_data->id() => $plan_data, - ]; + ] : []; } $filter = NULL; diff --git a/html/modules/custom/ghi_plans/src/ApiObjects/Attachments/DataAttachment.php b/html/modules/custom/ghi_plans/src/ApiObjects/Attachments/DataAttachment.php index 123207e36..ead52b0b9 100644 --- a/html/modules/custom/ghi_plans/src/ApiObjects/Attachments/DataAttachment.php +++ b/html/modules/custom/ghi_plans/src/ApiObjects/Attachments/DataAttachment.php @@ -514,6 +514,9 @@ private function assureDisaggregatedData() { /** @var \Drupal\ghi_plans\Plugin\EndpointQuery\AttachmentQuery $attachment_query */ $attachment_query = $this->getEndpointQueryManager()->createInstance('attachment_query'); $attachment_data = $attachment_query->getAttachmentDataWithDisaggregatedData($this->id); + if (!$attachment_data) { + return; + } $this->setRawData($attachment_data); $this->updateMap(); } diff --git a/html/modules/custom/ghi_plans/src/ApiObjects/Entities/PlanEntity.php b/html/modules/custom/ghi_plans/src/ApiObjects/Entities/PlanEntity.php index 2dd36bbdc..2b3cfe985 100644 --- a/html/modules/custom/ghi_plans/src/ApiObjects/Entities/PlanEntity.php +++ b/html/modules/custom/ghi_plans/src/ApiObjects/Entities/PlanEntity.php @@ -87,6 +87,9 @@ public function getParentIds() { if (empty($entity_version->value->support)) { return []; } + if (!is_array($entity_version->value->support)) { + return []; + } $first_ref = reset($entity_version->value->support); if (property_exists($first_ref, 'planEntityIds') && !empty($first_ref->planEntityIds)) { return $first_ref->planEntityIds;