From 5b08b765cb3876d3eb59f43410c668571911e9ab Mon Sep 17 00:00:00 2001 From: Eli Zoller Date: Mon, 30 Nov 2020 21:49:31 -0700 Subject: [PATCH] some of these urls are necessary as strings --- modules/islandora_iiif/src/Plugin/views/style/IIIFManifest.php | 2 +- src/Form/IslandoraSettingsForm.php | 2 ++ tests/src/Functional/JsonldSelfReferenceReactionTest.php | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/islandora_iiif/src/Plugin/views/style/IIIFManifest.php b/modules/islandora_iiif/src/Plugin/views/style/IIIFManifest.php index be71e0ee..eee2127a 100644 --- a/modules/islandora_iiif/src/Plugin/views/style/IIIFManifest.php +++ b/modules/islandora_iiif/src/Plugin/views/style/IIIFManifest.php @@ -186,7 +186,7 @@ class IIIFManifest extends StylePluginBase { foreach ($images as $image) { // Create the IIIF URL for this file // Visiting $iiif_url will resolve to the info.json for the image. - $file_url = $image->entity->toUrl(); + $file_url = $image->entity->toUrl()->toString(); $mime_type = $image->entity->getMimeType(); $iiif_url = rtrim($iiif_address, '/') . '/' . urlencode($file_url); diff --git a/src/Form/IslandoraSettingsForm.php b/src/Form/IslandoraSettingsForm.php index af1cdf2a..72ebf11d 100644 --- a/src/Form/IslandoraSettingsForm.php +++ b/src/Form/IslandoraSettingsForm.php @@ -7,6 +7,7 @@ use Drupal\Core\Entity\EntityTypeBundleInfoInterface; use Drupal\Core\Form\ConfigFormBase; use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Site\Settings; +use Drupal\Core\Url; use GuzzleHttp\Exception\ConnectException; use Islandora\Crayfish\Commons\Client\GeminiClient; use Stomp\Client; @@ -271,6 +272,7 @@ class IslandoraSettingsForm extends ConfigFormBase { $geminiUrlValue = trim($form_state->getValue(self::GEMINI_URL)); if (!empty($geminiUrlValue)) { try { + $geminiUrl = Url::fromUri($geminiUrlValue); $client = GeminiClient::create($geminiUrlValue, $this->logger('islandora')); $client->findByUri('http://example.org'); } diff --git a/tests/src/Functional/JsonldSelfReferenceReactionTest.php b/tests/src/Functional/JsonldSelfReferenceReactionTest.php index e1c5493c..f3c88271 100644 --- a/tests/src/Functional/JsonldSelfReferenceReactionTest.php +++ b/tests/src/Functional/JsonldSelfReferenceReactionTest.php @@ -153,7 +153,7 @@ class JsonldSelfReferenceReactionTest extends IslandoraFunctionalTestBase { $reaction_id = 'islandora_map_uri_predicate'; list($file, $media) = $this->makeMediaAndFile($account); - $media_url = $media->toUrl('canonical', ['absolute' => TRUE]); + $media_url = $media->toUrl('canonical', ['absolute' => TRUE])->toString(); $file_url = $file->createFileUrl(FALSE); $this->drupalGet($media_url);