From 58898239d4c505af7fb212fb82f8590167665d8e Mon Sep 17 00:00:00 2001 From: Rolf Schmidt Date: Fri, 5 Nov 2021 08:36:48 +0100 Subject: [PATCH] Fixes #3835 - Invalid group and owner list for tickets created via customer profile. --- .../ticket_zoom/form_handler_core_workflow.coffee | 6 +++++- spec/system/ticket/create_spec.rb | 12 ++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/app/controllers/ticket_zoom/form_handler_core_workflow.coffee b/app/assets/javascripts/app/controllers/ticket_zoom/form_handler_core_workflow.coffee index 305b117a1..fec12385a 100644 --- a/app/assets/javascripts/app/controllers/ticket_zoom/form_handler_core_workflow.coffee +++ b/app/assets/javascripts/app/controllers/ticket_zoom/form_handler_core_workflow.coffee @@ -330,8 +330,12 @@ class App.FormHandlerCoreWorkflow # get params and add id from ui if needed params = App.FormHandlerCoreWorkflow.cleanParams(params_ref) - if ui?.params?.id + + # add object id for edit screens + if ui?.params?.id && ui.screen.match(/edit/) params.id = ui.params.id + else + delete params.id # skip double checks return if _.isEqual(coreWorkflowParams[classname], params) diff --git a/spec/system/ticket/create_spec.rb b/spec/system/ticket/create_spec.rb index 5d4b25922..d729e97af 100644 --- a/spec/system/ticket/create_spec.rb +++ b/spec/system/ticket/create_spec.rb @@ -820,4 +820,16 @@ RSpec.describe 'Ticket Create', type: :system do expect(page).to have_no_text('mail002.box') end end + + describe 'Invalid group and owner list for tickets created via customer profile #3835' do + let(:invalid_ticket) { create(:ticket) } + + before do + visit "#ticket/create/id/#{invalid_ticket.id}/customer/#{User.find_by(firstname: 'Nicole').id}" + end + + it 'does show an empty list of owners' do + expect(page.all('select[name=owner_id] option').count).to eq(1) + end + end end