diff --git a/web/modules/custom/sfgov_api/src/Plugin/SfgApi/Media/File.php b/web/modules/custom/sfgov_api/src/Plugin/SfgApi/Media/File.php index 22c050ee1..5543b8c8a 100644 --- a/web/modules/custom/sfgov_api/src/Plugin/SfgApi/Media/File.php +++ b/web/modules/custom/sfgov_api/src/Plugin/SfgApi/Media/File.php @@ -30,8 +30,8 @@ public function setCustomData($entity) { $custom_data = [ 'description' => $entity->get('field_description')->value ?: '', 'published_date' => $entity->get('field_published_date')->value ?: NULL, - 'drupal_indirect_url' => $entity->toUrl()->toString(), - 'drupal_direct_url' => $drupal_direct_url, + 'drupal_indirect_path' => $entity->toUrl()->toString(), + 'drupal_direct_path' => $drupal_direct_url, ]; return $custom_data; } diff --git a/web/modules/custom/sfgov_api/src/Plugin/SfgApi/Media/Image.php b/web/modules/custom/sfgov_api/src/Plugin/SfgApi/Media/Image.php index 3edce525c..5ccea1cf7 100644 --- a/web/modules/custom/sfgov_api/src/Plugin/SfgApi/Media/Image.php +++ b/web/modules/custom/sfgov_api/src/Plugin/SfgApi/Media/Image.php @@ -21,8 +21,12 @@ class Image extends SfgApiMediaBase { * {@inheritDoc} */ public function setCustomData($entity) { - - $custom_data = []; + $referenced_file = $entity->get('field_media_image')->referencedEntities()[0]; + $drupal_direct_path = isset($referenced_file) ? $referenced_file->createFileUrl() : NULL; + $custom_data = [ + 'drupal_indirect_path' => $entity->toUrl()->toString(), + 'drupal_direct_path' => $drupal_direct_path, + ]; return $custom_data; }