From 7ddff5783479a7d0d00c98415c0c8c1545536812 Mon Sep 17 00:00:00 2001
From: ebremner <ebremner@uwaterloo.ca>
Date: Tue, 1 Jun 2021 16:35:50 -0400
Subject: [PATCH] ISTWCMS-4695: adding alt tag to responsive images in UW
 service

---
 src/Service/UWService.php | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/Service/UWService.php b/src/Service/UWService.php
index c3d7b339..f986c853 100644
--- a/src/Service/UWService.php
+++ b/src/Service/UWService.php
@@ -78,6 +78,9 @@ class UWService implements UWServiceInterface {
       $variables['uri'] = $file->getFileUri();
       $variables['responsive_image_style_id'] = $image_style;
 
+      // Set the alt for the image.
+      $variables['alt'] = $entity->field_media_image->alt;
+
       // These is a function from the responsive image module that sets all
       // the variables for the sources of the responsive image.
       template_preprocess_responsive_image($variables);
-- 
GitLab