From 9b3d64f34c2ba1debc8a6477db2f0816a9795708 Mon Sep 17 00:00:00 2001 From: Splines Date: Thu, 4 Apr 2024 00:15:21 +0200 Subject: [PATCH 1/3] Don't assume that `lecture` variable is present For example, when opening a worked example that is not attached to a particular lecture, it will be `nil`. In this case, we return the annotation status of the medium itself. --- app/models/medium.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/medium.rb b/app/models/medium.rb index 540e4e593..f0f079536 100644 --- a/app/models/medium.rb +++ b/app/models/medium.rb @@ -1092,7 +1092,7 @@ def subscribed_users # if "inherit from lecture" was selected (i.e. if the annotations status of # this medium is -1). def get_annotations_status # rubocop:todo Naming/AccessorMethodName - return lecture.annotations_status if annotations_status == -1 + return lecture.annotations_status if annotations_status == -1 && lecture.present? annotations_status end From fa2e98096f6f013bfd6c8975de7df2a9ee474014 Mon Sep 17 00:00:00 2001 From: Splines Date: Thu, 4 Apr 2024 00:22:45 +0200 Subject: [PATCH 2/3] Don't show emergency link if `lecture` is not present --- .../_form_content_further_help.html.erb | 27 ++++++++++--------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/app/views/annotations/_form_content_further_help.html.erb b/app/views/annotations/_form_content_further_help.html.erb index f3921f2a3..d2600963d 100644 --- a/app/views/annotations/_form_content_further_help.html.erb +++ b/app/views/annotations/_form_content_further_help.html.erb @@ -1,16 +1,19 @@ From baeaeeb17bff65ce91d4cadb6f9f576e01685008 Mon Sep 17 00:00:00 2001 From: Splines Date: Thu, 4 Apr 2024 00:25:45 +0200 Subject: [PATCH 3/3] Fix wrong tooltip for annotation button --- app/views/media/play.html.erb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/views/media/play.html.erb b/app/views/media/play.html.erb index a77620609..52b838860 100644 --- a/app/views/media/play.html.erb +++ b/app/views/media/play.html.erb @@ -64,7 +64,8 @@ <% if user_signed_in? %> - + <% end %>