From f89a90ff56d05fc1b6a7985ce8ec76b9f8c706fc Mon Sep 17 00:00:00 2001 From: Shana Moore Date: Wed, 4 Oct 2023 13:45:47 -0700 Subject: [PATCH 1/2] :bug: subject can't be blank for the contact form Previously there was a bug because even if you typed in a subject, the contact form would error saying that it was blank. Part of issue: - https://github.com/scientist-softserv/adventist-dl/issues/608 --- app/controllers/hyrax/contact_form_controller.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/controllers/hyrax/contact_form_controller.rb b/app/controllers/hyrax/contact_form_controller.rb index 17f6cb614..705d7e0b1 100644 --- a/app/controllers/hyrax/contact_form_controller.rb +++ b/app/controllers/hyrax/contact_form_controller.rb @@ -50,6 +50,7 @@ def create # not spam, form is valid, and captcha is valid @captcha.values[:category] = params[:contact_form][:category] @captcha.values[:contact_method] = params[:contact_form][:contact_method] + @captcha.values[:subjects] = params[:contact_form][:subject] @contact_form = model_class.new(@captcha.values) if @contact_form.valid? && @captcha.valid? ContactMailer.contact(@contact_form).deliver_now From 58f42ad34f08fda90737c66a1ea1598b52826495 Mon Sep 17 00:00:00 2001 From: Shana Moore Date: Wed, 4 Oct 2023 13:49:37 -0700 Subject: [PATCH 2/2] Update app/controllers/hyrax/contact_form_controller.rb --- app/controllers/hyrax/contact_form_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/hyrax/contact_form_controller.rb b/app/controllers/hyrax/contact_form_controller.rb index 705d7e0b1..a420f82d4 100644 --- a/app/controllers/hyrax/contact_form_controller.rb +++ b/app/controllers/hyrax/contact_form_controller.rb @@ -50,7 +50,7 @@ def create # not spam, form is valid, and captcha is valid @captcha.values[:category] = params[:contact_form][:category] @captcha.values[:contact_method] = params[:contact_form][:contact_method] - @captcha.values[:subjects] = params[:contact_form][:subject] + @captcha.values[:subject] = params[:contact_form][:subject] @contact_form = model_class.new(@captcha.values) if @contact_form.valid? && @captcha.valid? ContactMailer.contact(@contact_form).deliver_now