Browse Source

maxDepth counting should start at 1, not zero

pull/873/head
Seth Shaw 3 years ago
parent
commit
73d0d66402
  1. 2
      src/IslandoraUtils.php

2
src/IslandoraUtils.php

@ -714,7 +714,7 @@ class IslandoraUtils {
* @param int $current_height * @param int $current_height
* The current height of the recursion. * The current height of the recursion.
*/ */
protected function findAncestorsByEntityReference(ContentEntityInterface $entity, array &$context, array $fields = [self::MEMBER_OF_FIELD], int $current_height = 0): void { protected function findAncestorsByEntityReference(ContentEntityInterface $entity, array &$context, array $fields = [self::MEMBER_OF_FIELD], int $current_height = 1): void {
$parents = $this->getParentsByEntityReference($entity, $fields); $parents = $this->getParentsByEntityReference($entity, $fields);
foreach ($parents as $parent) { foreach ($parents as $parent) {
if (isset($context['ancestors'][$parent->id()])) { if (isset($context['ancestors'][$parent->id()])) {

Loading…
Cancel
Save