diff --git a/src/Plugin/Field/FieldFormatter/IslandoraImageFormatter.php b/src/Plugin/Field/FieldFormatter/IslandoraImageFormatter.php index 9feecd14..a3ee788e 100644 --- a/src/Plugin/Field/FieldFormatter/IslandoraImageFormatter.php +++ b/src/Plugin/Field/FieldFormatter/IslandoraImageFormatter.php @@ -124,7 +124,7 @@ class IslandoraImageFormatter extends ImageFormatter { return $elements; } - $url = $node->toUrl()->toString(); + $url = $node->toUrl(); foreach ($elements as &$element) { $element['#url'] = $url; diff --git a/tests/src/Functional/IslandoraImageFormatterTest.php b/tests/src/Functional/IslandoraImageFormatterTest.php index 6baf1bfc..9572b1e7 100644 --- a/tests/src/Functional/IslandoraImageFormatterTest.php +++ b/tests/src/Functional/IslandoraImageFormatterTest.php @@ -78,11 +78,12 @@ class IslandoraImageFormatterTest extends IslandoraFunctionalTestBase { // Assert that the image is rendered into html as a link pointing // to the Node, not the Media (that's what the islandora_image // formatter does). + $elements = $this->xpath( '//a[@href=:path]/img[@src=:url and @alt=:alt and @title=:title]', [ ':path' => $node->toUrl()->toString(), - ':url' => file_url_transform_relative(file_create_url($file->getFileUri())), + ':url' => $file->createFileUrl(), ':alt' => 'Some Alt', ':title' => 'Some Title', ]