diff --git a/src/Plugin/Field/FieldFormatter/DoiFieldFormatter.php b/src/Plugin/Field/FieldFormatter/DoiFieldFormatter.php index d769aa6..0c35c4b 100644 --- a/src/Plugin/Field/FieldFormatter/DoiFieldFormatter.php +++ b/src/Plugin/Field/FieldFormatter/DoiFieldFormatter.php @@ -41,8 +41,9 @@ class DoiFieldFormatter extends FormatterBase { foreach ($items as $delta => $item) { $prefix = 'https://doi.org/'; + // Assumes all field values are just plain text or strings values and not full doi URLS. $doiUrl = $prefix . $item->value; - $link = Link::fromTextAndUrl($item->value, Url::fromUri($doiUrl)); + $link = Link::fromTextAndUrl($doiUrl, Url::fromUri($doiUrl)); $element[$delta] = [$link->toRenderable()]; } return $element;