diff --git a/modules/islandora_breadcrumbs/config/install/islandora_breadcrumbs.breadcrumbs.yml b/modules/islandora_breadcrumbs/config/install/islandora_breadcrumbs.breadcrumbs.yml index ad166b50..ea34ee2e 100644 --- a/modules/islandora_breadcrumbs/config/install/islandora_breadcrumbs.breadcrumbs.yml +++ b/modules/islandora_breadcrumbs/config/install/islandora_breadcrumbs.breadcrumbs.yml @@ -1,6 +1,7 @@ maxDepth: -1 includeSelf: FALSE -referenceField: field_member_of +referenceFields: + - field_member_of dependencies: module: - islandora diff --git a/modules/islandora_breadcrumbs/config/schema/islandora_breadcrumbs.schema.yml b/modules/islandora_breadcrumbs/config/schema/islandora_breadcrumbs.schema.yml index 6bc44096..4175cbf5 100644 --- a/modules/islandora_breadcrumbs/config/schema/islandora_breadcrumbs.schema.yml +++ b/modules/islandora_breadcrumbs/config/schema/islandora_breadcrumbs.schema.yml @@ -7,6 +7,9 @@ islandora_breadcrumbs.breadcrumbs: includeSelf: type: boolean label: 'Include Self' - referenceField: - type: string - label: 'Reference Field' + referenceFields: + type: sequence + label: 'Reference Fields' + sequence: + type: string + label: 'Reference Field' diff --git a/modules/islandora_breadcrumbs/islandora_breadcrumbs.install b/modules/islandora_breadcrumbs/islandora_breadcrumbs.install new file mode 100644 index 00000000..2c220801 --- /dev/null +++ b/modules/islandora_breadcrumbs/islandora_breadcrumbs.install @@ -0,0 +1,18 @@ +getEditable('islandora_breadcrumbs.breadcrumbs'); + $config->set('referenceFields', [$config->get('referenceField')]); + $config->clear('referenceField'); + $config->save(); + return "Updated referenceFields config."; +} \ No newline at end of file diff --git a/modules/islandora_breadcrumbs/src/IslandoraBreadcrumbBuilder.php b/modules/islandora_breadcrumbs/src/IslandoraBreadcrumbBuilder.php index 620f2289..23d3ff3c 100644 --- a/modules/islandora_breadcrumbs/src/IslandoraBreadcrumbBuilder.php +++ b/modules/islandora_breadcrumbs/src/IslandoraBreadcrumbBuilder.php @@ -78,7 +78,7 @@ class IslandoraBreadcrumbBuilder implements BreadcrumbBuilderInterface { $breadcrumb = new Breadcrumb(); $breadcrumb->addLink(Link::createFromRoute($this->t('Home'), '')); - $chain = array_reverse($this->utils->findAncestors($node, [$this->config->get('referenceField')], $this->config->get('maxDepth'))); + $chain = array_reverse($this->utils->findAncestors($node, $this->config->get('referenceFields'), $this->config->get('maxDepth'))); // XXX: Handle a looping breadcrumb scenario by filtering the present // node out and then optionally re-adding it after if set to do so.