From 47b72864bec49713288cb4d1cea160c87adbdde1 Mon Sep 17 00:00:00 2001 From: Mantas Masalskis Date: Wed, 17 Nov 2021 15:04:57 +0100 Subject: [PATCH] Fixes #3855 - Forwarding no longer possible for email and web articles --- .../app/lib/app_post/full_quote_header.coffee | 4 ++-- .../ticket/update/full_quote_header_spec.rb | 22 +++++++++++++++++++ 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/app/lib/app_post/full_quote_header.coffee b/app/assets/javascripts/app/lib/app_post/full_quote_header.coffee index 712ca9e2e..fc21173f4 100644 --- a/app/assets/javascripts/app/lib/app_post/full_quote_header.coffee +++ b/app/assets/javascripts/app/lib/app_post/full_quote_header.coffee @@ -41,11 +41,11 @@ class App.FullQuoteHeader article.to @fullQuoteHeaderForwardCC: (article) -> - return if !article.cc - @fullQuoteHeaderEnsureMultiPrivacy(article.cc) @fullQuoteHeaderEnsureMultiPrivacy: (input) -> + return if !input + input .split(',') .map (elem) -> diff --git a/spec/system/ticket/update/full_quote_header_spec.rb b/spec/system/ticket/update/full_quote_header_spec.rb index 567ea2eee..a230702fa 100644 --- a/spec/system/ticket/update/full_quote_header_spec.rb +++ b/spec/system/ticket/update/full_quote_header_spec.rb @@ -101,6 +101,28 @@ RSpec.describe 'Ticket > Update > Full Quote Header', current_user_id: -> { curr end end end + + # https://github.com/zammad/zammad/issues/3855 + context 'when ticket article has no recipient' do + shared_examples 'when recipient is set to' do |recipient:, recipient_human:| + context "when recipient is set to #{recipient_human}" do + let(:ticket_article) { create(:ticket_article, :inbound_web, ticket: ticket, to: recipient) } + + it 'allows to forward without original recipient present' do + within(:active_content) do + click_forward + + within(:richtext) do + expect(page).to contain_full_quote(ticket_article).formatted_for(:forward) + end + end + end + end + end + + include_examples 'when recipient is set to', recipient: '', recipient_human: 'empty string' + include_examples 'when recipient is set to', recipient: nil, recipient_human: 'nil' + end end context 'when "ui_ticket_zoom_article_email_full_quote_header" is disabled' do