From 78ce3477674b8d016b1bc1abc14f3f95abe44b7f Mon Sep 17 00:00:00 2001 From: Edmund Dunn <109987005+edmund-dunn@users.noreply.github.com> Date: Fri, 29 Sep 2023 07:21:26 -0700 Subject: [PATCH] VACMS-15447: fixed php error in orphans report (#15451) --- config/sync/views.view.orphaned_paragraphs.yml | 3 ++- .../src/EventSubscriber/OrphansReportViewsEventSubscriber.php | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/config/sync/views.view.orphaned_paragraphs.yml b/config/sync/views.view.orphaned_paragraphs.yml index a936858489..efa84c4292 100644 --- a/config/sync/views.view.orphaned_paragraphs.yml +++ b/config/sync/views.view.orphaned_paragraphs.yml @@ -482,7 +482,7 @@ display: type: full options: offset: 0 - items_per_page: 2500 + items_per_page: 20 total_pages: null id: 0 tags: @@ -499,6 +499,7 @@ display: offset: false offset_label: Offset quantity: 9 + pagination_heading_level: h4 exposed_form: type: basic options: diff --git a/docroot/modules/custom/va_gov_backend/src/EventSubscriber/OrphansReportViewsEventSubscriber.php b/docroot/modules/custom/va_gov_backend/src/EventSubscriber/OrphansReportViewsEventSubscriber.php index 817b4eda4d..5e85f58a41 100644 --- a/docroot/modules/custom/va_gov_backend/src/EventSubscriber/OrphansReportViewsEventSubscriber.php +++ b/docroot/modules/custom/va_gov_backend/src/EventSubscriber/OrphansReportViewsEventSubscriber.php @@ -152,7 +152,8 @@ public function preRender(ViewsPreRenderEvent $event): void { foreach ($view->result as $key => $value) { /** @var \Drupal\paragraphs\Entity\Paragraph $paragraph */ $paragraph = $value->_entity; - $top_parent = va_gov_backend_get_top_parent_entity($paragraph); + $tree = []; + $top_parent = va_gov_backend_get_top_parent_entity($paragraph, $tree); $used = $this->purger->isUsed($paragraph); if (!$used && !$top_parent) { $link = $this->getTopParentEntityLink($paragraph);