From 3d2eb697362a2e5832d6029dcee126fece4504dc Mon Sep 17 00:00:00 2001 From: Seth Shaw Date: Wed, 2 Sep 2020 14:19:34 -0700 Subject: [PATCH 1/4] remove requirement for a value in the configured reference field (for collections) --- .../islandora_breadcrumbs/src/IslandoraBreadcrumbBuilder.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/islandora_breadcrumbs/src/IslandoraBreadcrumbBuilder.php b/modules/islandora_breadcrumbs/src/IslandoraBreadcrumbBuilder.php index 86090ff1..99ff4894 100644 --- a/modules/islandora_breadcrumbs/src/IslandoraBreadcrumbBuilder.php +++ b/modules/islandora_breadcrumbs/src/IslandoraBreadcrumbBuilder.php @@ -54,7 +54,7 @@ class IslandoraBreadcrumbBuilder implements BreadcrumbBuilderInterface { $nid = $attributes->getRawParameters()->get('node'); if (!empty($nid)) { $node = $this->nodeStorage->load($nid); - return (!empty($node) && $node->hasField($this->config->get('referenceField')) && !$node->get($this->config->get('referenceField'))->isEmpty()); + return (!empty($node) && $node->hasField($this->config->get('referenceField'))); } } From c4c602a9c9273b9e4cecc36f9771f529a3779bbf Mon Sep 17 00:00:00 2001 From: Seth Shaw Date: Thu, 3 Sep 2020 18:22:32 +0000 Subject: [PATCH 2/4] add deleting node to test --- .../tests/src/Functional/BreadcrumbsTest.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/modules/islandora_breadcrumbs/tests/src/Functional/BreadcrumbsTest.php b/modules/islandora_breadcrumbs/tests/src/Functional/BreadcrumbsTest.php index 18fa030e..80f5dbee 100644 --- a/modules/islandora_breadcrumbs/tests/src/Functional/BreadcrumbsTest.php +++ b/modules/islandora_breadcrumbs/tests/src/Functional/BreadcrumbsTest.php @@ -114,6 +114,18 @@ class BreadcrumbsTest extends IslandoraFunctionalTestBase { // We should still escape it and have the same trail as before. $this->assertBreadcrumb($this->nodeD->toUrl()->toString(), $breadcrumbs); + + // Delete 'A', removing it from the chain. + $this->nodeA->delete(); + + // The new breadcrumb chain without 'A'. + $breadcrumbs = [ + Url::fromRoute('')->toString() => 'Home', + $this->nodeB->toUrl()->toString() => $this->nodeB->label(), + $this->nodeC->toUrl()->toString() => $this->nodeC->label(), + ]; + + $this->assertBreadcrumb($this->nodeD->toUrl()->toString(), $breadcrumbs); } } From 54ff6e0566850f493e6a79a13e82725f304e7796 Mon Sep 17 00:00:00 2001 From: Seth Shaw Date: Fri, 4 Sep 2020 08:31:04 -0700 Subject: [PATCH 3/4] debug travis build failure --- .travis.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.travis.yml b/.travis.yml index b0dcc8ce..c73c83dd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -43,8 +43,12 @@ script: - $SCRIPT_DIR/run-tests.sh "islandora_video" - $SCRIPT_DIR/run-tests.sh "islandora_text_extraction" +after_script: + - ps -ef + after_success: - bash <(curl -s https://codecov.io/bash) + - ps -ef notifications: slack: From 4bb18d8855d54d41e58ef8ee9e7df9b70f6d3196 Mon Sep 17 00:00:00 2001 From: Seth Shaw Date: Fri, 4 Sep 2020 09:32:00 -0700 Subject: [PATCH 4/4] remove travis debugging --- .travis.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index c73c83dd..b0dcc8ce 100644 --- a/.travis.yml +++ b/.travis.yml @@ -43,12 +43,8 @@ script: - $SCRIPT_DIR/run-tests.sh "islandora_video" - $SCRIPT_DIR/run-tests.sh "islandora_text_extraction" -after_script: - - ps -ef - after_success: - bash <(curl -s https://codecov.io/bash) - - ps -ef notifications: slack: