From cb513c6038733f1e4a3a5f5db15e0f34f2f89ddb Mon Sep 17 00:00:00 2001
From: Brian Canini <canini.16@osu.edu>
Date: Wed, 17 Jul 2024 10:26:09 -0400
Subject: [PATCH] OPIC error handling - javascript on user profile page to swap
 out image for defaultbuckeye leaf if user is using OPIC image and OPIC is
 down

---
 web/themes/asc_bootstrap_bux/templates/system/user.html.twig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/web/themes/asc_bootstrap_bux/templates/system/user.html.twig b/web/themes/asc_bootstrap_bux/templates/system/user.html.twig
index ad0da1a6ed..6c77620309 100644
--- a/web/themes/asc_bootstrap_bux/templates/system/user.html.twig
+++ b/web/themes/asc_bootstrap_bux/templates/system/user.html.twig
@@ -24,7 +24,7 @@
         {% if (content.user_picture.0 != '') and (user.field_use_opic.value == false) %}
           {{ content.user_picture }}
         {% elseif user.field_use_opic.value %}
-          <img src="https://opic.osu.edu/{{ content.field_osu_name_num.0 }}?aspect=p&width=300" alt="{% if (content.field_first_name.0 != '') and (content.field_last_name.0 != '') %}{{ content.field_first_name.0 }} {{ content.field_last_name.0 }}{% endif %}" />
+          <img src="https://opic.osu.edu/{{ content.field_osu_name_num.0 }}?aspect=p&width=300" alt="{% if (content.field_first_name.0 != '') and (content.field_last_name.0 != '') %}{{ content.field_first_name.0 }} {{ content.field_last_name.0 }}{% endif %}" onerror="this.onerror=null;this.src='/themes/asc_bootstrap/images/profile-avatar/user-profile.png';" />
         {% else %}
           <img src="/themes/asc_bootstrap/images/profile-avatar/user-profile.png" alt="{% if (content.field_first_name.0 != '') and (content.field_last_name.0 != '') %}{{ content.field_first_name.0 }} {{ content.field_last_name.0 }}{% endif %}" />
         {% endif %}
-- 
GitLab