From 75fdf7fbedf9b6e11831581648339ecced754a6d Mon Sep 17 00:00:00 2001 From: Ben Halpern Date: Fri, 3 May 2019 11:09:21 -0400 Subject: [PATCH] Ben/fix social image blank (#2675) * Add profile_image_90 to serialized data on article * Fix issue where empty string social image causes blank social image --- app/helpers/social_image_helper.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/helpers/social_image_helper.rb b/app/helpers/social_image_helper.rb index b96d36f0c..d7833819a 100644 --- a/app/helpers/social_image_helper.rb +++ b/app/helpers/social_image_helper.rb @@ -14,7 +14,8 @@ module SocialImageHelper end def article_social_image_url(article) - if (image = article.social_image || article.main_image || article.video_thumbnail_url) + image = article.social_image || article.main_image || article.video_thumbnail_url + if image.present? return cl_image_path(image, type: "fetch", width: "1000", @@ -26,6 +27,7 @@ module SocialImageHelper sign_url: true) end return legacy_article_social_image(article) unless use_new_social_url?(article) + article_social_preview_url(article, format: :png) end