Loading npr_pull/src/NprPullClient.php +3 −2 Original line number Diff line number Diff line Loading @@ -13,6 +13,7 @@ use Drupal\Core\Url; use Drupal\media\Entity\Media; use Drupal\npr_api\NprClient; use Drupal\taxonomy\Entity\Term; use Drupal\Component\Utility\Unicode; /** * Performs CRUD operations on Drupal nodes using data from the NPR API. Loading Loading @@ -517,7 +518,7 @@ class NprPullClient extends NprClient { if (!empty($caption_field) && $caption_field != 'unused') { $caption = $referenced_image->get($caption_field)->value; // NOTE: The API doesn't seem to send alt text, so re-using caption. $alt = $caption; $alt = Unicode::truncate($caption, 512, FALSE, TRUE); } if (!empty($copyright_field) && $copyright_field != 'unused') { $copyright = $referenced_image->get($copyright_field)->value; Loading Loading @@ -873,7 +874,7 @@ class NprPullClient extends NprClient { // Attached the image file to the media item. $media_image->set($image_field, [ 'target_id' => $file->id(), 'alt' => $image->caption->value, 'alt' => Unicode::truncate($image->caption->value, 512, FALSE, TRUE), ]); // Map all of the remaining fields except image_title and image_field, Loading Loading
npr_pull/src/NprPullClient.php +3 −2 Original line number Diff line number Diff line Loading @@ -13,6 +13,7 @@ use Drupal\Core\Url; use Drupal\media\Entity\Media; use Drupal\npr_api\NprClient; use Drupal\taxonomy\Entity\Term; use Drupal\Component\Utility\Unicode; /** * Performs CRUD operations on Drupal nodes using data from the NPR API. Loading Loading @@ -517,7 +518,7 @@ class NprPullClient extends NprClient { if (!empty($caption_field) && $caption_field != 'unused') { $caption = $referenced_image->get($caption_field)->value; // NOTE: The API doesn't seem to send alt text, so re-using caption. $alt = $caption; $alt = Unicode::truncate($caption, 512, FALSE, TRUE); } if (!empty($copyright_field) && $copyright_field != 'unused') { $copyright = $referenced_image->get($copyright_field)->value; Loading Loading @@ -873,7 +874,7 @@ class NprPullClient extends NprClient { // Attached the image file to the media item. $media_image->set($image_field, [ 'target_id' => $file->id(), 'alt' => $image->caption->value, 'alt' => Unicode::truncate($image->caption->value, 512, FALSE, TRUE), ]); // Map all of the remaining fields except image_title and image_field, Loading