Browse Source

Use correct context term.

main
Rosie Le Faive 1 day ago
parent
commit
446193a539
  1. 2
      islandlives.module

2
islandlives.module

@ -26,7 +26,7 @@ function islandlives_pathauto_pattern_alter(PathautoPatternInterface $pattern, a
// Taxonomy Terms: Only act if the pattern has machine name `person_vocabulary`.
if ($pattern->id() == 'person_vocabulary') {
// If term has no PID...
$term = $context['data']['taxonomy_term'];
$term = $context['data']['term'];
$pid = $term->get('field_pid')->value;
if ($pid == NULL) {
// Replace the PID with the TID in the alias.

Loading…
Cancel
Save