Browse Source

replace more url() -> toUrl() and remove unused variables

d9_islandora
Eli Zoller 4 years ago
parent
commit
ec648e6e15
  1. 2
      modules/islandora_iiif/src/Plugin/views/style/IIIFManifest.php
  2. 1
      src/ContextProvider/MediaRouteContextProvider.php
  3. 1
      src/EventGenerator/EventGenerator.php
  4. 1
      src/EventSubscriber/LinkHeaderSubscriber.php
  5. 1
      src/Form/ConfirmDeleteMediaAndFile.php
  6. 1
      src/Form/IslandoraSettingsForm.php
  7. 1
      src/Plugin/Action/AbstractGenerateDerivativeMediaFile.php
  8. 1
      tests/src/Functional/ContentEntityTypeTest.php
  9. 2
      tests/src/Functional/JsonldSelfReferenceReactionTest.php
  10. 1
      tests/src/Kernel/FedoraAdapterTest.php

2
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->url();
$file_url = $image->entity->toUrl();
$mime_type = $image->entity->getMimeType();
$iiif_url = rtrim($iiif_address, '/') . '/' . urlencode($file_url);

1
src/ContextProvider/MediaRouteContextProvider.php

@ -39,7 +39,6 @@ class MediaRouteContextProvider implements ContextProviderInterface {
* {@inheritdoc}
*/
public function getRuntimeContexts(array $unqualified_context_ids) {
$result = [];
$context_definition = EntityContextDefinition::fromEntityTypeId('media')->setLabel(NULL)->setRequired(FALSE);
$value = NULL;

1
src/EventGenerator/EventGenerator.php

@ -96,7 +96,6 @@ class EventGenerator implements EventGeneratorInterface {
$event["target"] = $fedora_url;
$entity_type = $entity->getEntityTypeId();
$event_type = $data["event"];
if ($data["event"] == "Generate Derivative") {
$event["type"] = "Activity";
$event["summary"] = $data["event"];

1
src/EventSubscriber/LinkHeaderSubscriber.php

@ -263,7 +263,6 @@ abstract class LinkHeaderSubscriber implements EventSubscriberInterface {
$current_format = $this->requestStack->getCurrentRequest()->query->get('_format');
$links = [];
$route_name = $this->routeMatch->getRouteName();
if ($rest_resource_config) {
$formats = $rest_resource_config->getFormats("GET");

1
src/Form/ConfirmDeleteMediaAndFile.php

@ -127,7 +127,6 @@ class ConfirmDeleteMediaAndFile extends DeleteMultipleForm {
}
// Check for files.
$fields = $this->entityFieldManager->getFieldDefinitions('media', $entity->bundle());
$files = [];
foreach ($fields as $field) {
$type = $field->getType();
if ($type == 'file' || $type == 'image') {

1
src/Form/IslandoraSettingsForm.php

@ -272,7 +272,6 @@ 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');
}

1
src/Plugin/Action/AbstractGenerateDerivativeMediaFile.php

@ -273,7 +273,6 @@ class AbstractGenerateDerivativeMediaFile extends EmitEvent {
*/
public function validateConfigurationForm(array &$form, FormStateInterface $form_state) {
parent::validateConfigurationForm($form, $form_state);
$mimetype = $form_state->getValue('mimetype');
$exploded = explode('/', $form_state->getValue('mimetype'));
if (count($exploded) != 2) {
$form_state->setErrorByName(

1
tests/src/Functional/ContentEntityTypeTest.php

@ -48,7 +48,6 @@ class ContentEntityTypeTest extends IslandoraFunctionalTestBase {
// Add a new media and confirm Hello World! is not printed to the
// screen.
$file = current($this->getTestFiles('file'));
$values = [
'name[0][value]' => 'Test Media',
'files[field_media_file_0]' => __DIR__ . '/../../fixtures/test_file.txt',

2
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->url('canonical', ['absolute' => TRUE]);
$media_url = $media->toUrl('canonical', ['absolute' => TRUE]);
$file_url = $file->createFileUrl(FALSE);
$this->drupalGet($media_url);

1
tests/src/Kernel/FedoraAdapterTest.php

@ -621,7 +621,6 @@ class FedoraAdapterTest extends IslandoraKernelTestBase {
$response = $prophecy->reveal();
$date = new \DateTime();
$timestamp = $date->format("D, d M Y H:i:s O");
$fedora_prophecy->createVersion('',
Argument::any(), NULL,
Argument::any())->willReturn($prophecy->reveal());

Loading…
Cancel
Save