From db3d115cbd0a24dfdae5f179d804b89ffd5ac244 Mon Sep 17 00:00:00 2001 From: weeklies <80141759+weeklies@users.noreply.github.com> Date: Fri, 15 Sep 2023 15:41:11 +0800 Subject: [PATCH] AO3-6058 Fixing --- app/helpers/works_helper.rb | 6 ++++-- app/views/downloads/_download_preface.html.erb | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/app/helpers/works_helper.rb b/app/helpers/works_helper.rb index c86c73bb932..5c3a4b1eae6 100644 --- a/app/helpers/works_helper.rb +++ b/app/helpers/works_helper.rb @@ -114,7 +114,9 @@ def get_inspired_by(work) def related_work_note(related_work, relation, download: false) work_link = link_to related_work.title, polymorphic_url(related_work) - language = tag.span(related_work.language.name, lang: related_work.language.short) + language = if related_work.language + tag.span(related_work.language.name, lang: related_work.language.short) + end creator_link = if download byline(related_work.work, visibility: "public", only_path: false) @@ -127,7 +129,7 @@ def related_work_note(related_work, relation, download: false) t(".#{relation}.unrevealed_html", language: language) else - t(".#{relation}.unrevealed_html") + t(".#{relation}.unrevealed") end elsif related_work.restricted? && !logged_in? t(".#{relation}.restricted_html", diff --git a/app/views/downloads/_download_preface.html.erb b/app/views/downloads/_download_preface.html.erb index f64837c3cd6..f0c854a82ae 100644 --- a/app/views/downloads/_download_preface.html.erb +++ b/app/views/downloads/_download_preface.html.erb @@ -77,7 +77,7 @@ <% related_works.each do |work| %>