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

This commit is contained in:
Rolf Schmidt 2021-11-05 13:57:53 +01:00
parent 1bd1cd669f
commit ff6af07b9a
2 changed files with 18 additions and 1 deletions

View file

@ -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)

View file

@ -771,4 +771,17 @@ 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
wait(5).until { page.all('select[name=owner_id] option').count == 1 }
expect(page.all('select[name=owner_id] option').count).to eq(1)
end
end
end