Browse Source

used a more specific parameter class, also fixed missing variable

pull/836/head
Willow Gillingham 5 years ago
parent
commit
153d1d6d8c
  1. 4
      islandora.tokens.inc

4
islandora.tokens.inc

@ -62,6 +62,7 @@ function islandora_tokens($type, $tokens, array $data, array $options, Bubbleabl
]); ]);
return; return;
} }
$islandoraUtils = \Drupal::service('islandora.utils');
foreach ($tokens as $name => $original) { foreach ($tokens as $name => $original) {
switch ($name) { switch ($name) {
case 'media-thumbnail-image:url': case 'media-thumbnail-image:url':
@ -82,7 +83,6 @@ function islandora_tokens($type, $tokens, array $data, array $options, Bubbleabl
case 'media-thumbnail-image:alt': case 'media-thumbnail-image:alt':
case 'media_thumbnail_image:alt': case 'media_thumbnail_image:alt':
$alt = ''; $alt = '';
$islandoraUtils = \Drupal::service('islandora.utils');
$term = $islandoraUtils->getTermForUri('http://pcdm.org/use#ThumbnailImage'); $term = $islandoraUtils->getTermForUri('http://pcdm.org/use#ThumbnailImage');
$media = $islandoraUtils->getMediaWithTerm($data['node'], $term); $media = $islandoraUtils->getMediaWithTerm($data['node'], $term);
// Is there media? // Is there media?
@ -108,7 +108,7 @@ function islandora_tokens($type, $tokens, array $data, array $options, Bubbleabl
* @todo: Add to IslandoraUtils? * @todo: Add to IslandoraUtils?
* @todo: Had to remove typehint MediaInterface from function. * @todo: Had to remove typehint MediaInterface from function.
* *
* @param \Drupal\media\MediaInterface $media * @param \Drupal\islandora\MediaSource\MediaSourceService $media
* The Media to operate on. * The Media to operate on.
* *
* @return mixed * @return mixed

Loading…
Cancel
Save