mirror of
https://github.com/meineerde/redmine.git
synced 2025-12-19 15:01:14 +00:00
Don't create a journal when creating an issue with attachments.
git-svn-id: http://svn.redmine.org/redmine/trunk@13733 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
2462a8581d
commit
95810125bf
@ -407,9 +407,9 @@ class IssuesController < ApplicationController
|
|||||||
def build_new_issue_from_params
|
def build_new_issue_from_params
|
||||||
if params[:id].blank?
|
if params[:id].blank?
|
||||||
@issue = Issue.new
|
@issue = Issue.new
|
||||||
@issue.init_journal(User.current)
|
|
||||||
if params[:copy_from]
|
if params[:copy_from]
|
||||||
begin
|
begin
|
||||||
|
@issue.init_journal(User.current)
|
||||||
@copy_from = Issue.visible.find(params[:copy_from])
|
@copy_from = Issue.visible.find(params[:copy_from])
|
||||||
@link_copy = link_copy?(params[:link_copy]) || request.get?
|
@link_copy = link_copy?(params[:link_copy]) || request.get?
|
||||||
@copy_attachments = params[:copy_attachments].present? || request.get?
|
@copy_attachments = params[:copy_attachments].present? || request.get?
|
||||||
|
|||||||
@ -2225,11 +2225,13 @@ class IssuesControllerTest < ActionController::TestCase
|
|||||||
|
|
||||||
assert_difference 'Issue.count' do
|
assert_difference 'Issue.count' do
|
||||||
assert_difference 'Attachment.count' do
|
assert_difference 'Attachment.count' do
|
||||||
|
assert_no_difference 'Journal.count' do
|
||||||
post :create, :project_id => 1,
|
post :create, :project_id => 1,
|
||||||
:issue => { :tracker_id => '1', :subject => 'With attachment' },
|
:issue => { :tracker_id => '1', :subject => 'With attachment' },
|
||||||
:attachments => {'1' => {'file' => uploaded_test_file('testfile.txt', 'text/plain'), 'description' => 'test file'}}
|
:attachments => {'1' => {'file' => uploaded_test_file('testfile.txt', 'text/plain'), 'description' => 'test file'}}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
issue = Issue.order('id DESC').first
|
issue = Issue.order('id DESC').first
|
||||||
attachment = Attachment.order('id DESC').first
|
attachment = Attachment.order('id DESC').first
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user