Fixes #3835 - Invalid group and owner list for tickets created via customer profile.

This commit is contained in:
Rolf Schmidt 2021-11-05 08:36:48 +01:00
parent b7440faad1
commit 58898239d4
2 changed files with 17 additions and 1 deletions

View file

@ -330,8 +330,12 @@ class App.FormHandlerCoreWorkflow
# get params and add id from ui if needed # get params and add id from ui if needed
params = App.FormHandlerCoreWorkflow.cleanParams(params_ref) 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 params.id = ui.params.id
else
delete params.id
# skip double checks # skip double checks
return if _.isEqual(coreWorkflowParams[classname], params) return if _.isEqual(coreWorkflowParams[classname], params)

View file

@ -820,4 +820,16 @@ RSpec.describe 'Ticket Create', type: :system do
expect(page).to have_no_text('mail002.box') expect(page).to have_no_text('mail002.box')
end end
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 end