mirror of
https://github.com/meineerde/redmine.git
synced 2026-02-11 13:15:20 +00:00
Patches by Takashi Kato (user:tohosaku). git-svn-id: https://svn.redmine.org/redmine/trunk@24248 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
64629e8890
commit
b88b61444c
2
Gemfile
2
Gemfile
@ -2,7 +2,7 @@ source 'https://rubygems.org'
|
||||
|
||||
ruby '>= 3.2.0', '< 3.5.0'
|
||||
|
||||
gem 'rails', '8.0.4'
|
||||
gem 'rails', '8.1.1'
|
||||
gem 'rouge', '~> 4.5'
|
||||
gem 'mini_mime', '~> 1.1.0'
|
||||
gem "actionpack-xml_parser"
|
||||
|
||||
@ -1567,13 +1567,6 @@ module ApplicationHelper
|
||||
fields_for(*args, &)
|
||||
end
|
||||
|
||||
def form_tag_html(html_options)
|
||||
# Set a randomized name attribute on all form fields by default
|
||||
# as a workaround to https://bugzilla.mozilla.org/show_bug.cgi?id=1279253
|
||||
html_options['name'] ||= "#{html_options['id'] || 'form'}-#{SecureRandom.hex(4)}"
|
||||
super
|
||||
end
|
||||
|
||||
# Render the error messages for the given objects
|
||||
def error_messages_for(*objects)
|
||||
objects = objects.filter_map {|o| o.is_a?(String) ? instance_variable_get(:"@#{o}") : o}
|
||||
|
||||
@ -102,6 +102,25 @@ module ActionView
|
||||
super
|
||||
end
|
||||
end)
|
||||
module Helpers
|
||||
# Set a randomized name attribute on all form fields by default
|
||||
# as a workaround to https://bugzilla.mozilla.org/show_bug.cgi?id=1279253
|
||||
FormHelper.prepend(Module.new do
|
||||
def form_tag_html(html_options)
|
||||
randomized_name_attribute(html_options)
|
||||
super
|
||||
end
|
||||
|
||||
def form_tag_with_body(html_options, output)
|
||||
randomized_name_attribute(html_options)
|
||||
super
|
||||
end
|
||||
|
||||
def randomized_name_attribute(html_options)
|
||||
html_options['name'] ||= "#{html_options['id'] || 'form'}-#{SecureRandom.hex(4)}"
|
||||
end
|
||||
end)
|
||||
end
|
||||
end
|
||||
|
||||
module ActionController
|
||||
|
||||
@ -6984,7 +6984,7 @@ class IssuesControllerTest < Redmine::ControllerTest
|
||||
:update,
|
||||
params: {
|
||||
id: private_issue.id,
|
||||
issue: { assigned_to_id: nil },
|
||||
issue: { assigned_to_id: '' },
|
||||
time_entry: {
|
||||
comments: "add spent time", activity_id: TimeEntryActivity.first.id, hours: 1
|
||||
}
|
||||
|
||||
@ -430,7 +430,7 @@ class TimelogControllerTest < Redmine::ControllerTest
|
||||
},
|
||||
:continue => '1'
|
||||
}
|
||||
assert_redirected_to '/time_entries/new?time_entry%5Bactivity_id%5D=11&time_entry%5Bissue_id%5D=&time_entry%5Bproject_id%5D=1&time_entry%5Bspent_on%5D=2008-03-14'
|
||||
assert_redirected_to '/time_entries/new?time_entry%5Bactivity_id%5D=11&time_entry%5Bissue_id%5D&time_entry%5Bproject_id%5D=1&time_entry%5Bspent_on%5D=2008-03-14'
|
||||
end
|
||||
end
|
||||
|
||||
@ -464,7 +464,7 @@ class TimelogControllerTest < Redmine::ControllerTest
|
||||
},
|
||||
:continue => '1'
|
||||
}
|
||||
assert_redirected_to '/projects/ecookbook/time_entries/new?time_entry%5Bactivity_id%5D=11&time_entry%5Bissue_id%5D=&time_entry%5Bproject_id%5D=1&time_entry%5Bspent_on%5D=2008-03-14'
|
||||
assert_redirected_to '/projects/ecookbook/time_entries/new?time_entry%5Bactivity_id%5D=11&time_entry%5Bissue_id%5D&time_entry%5Bproject_id%5D=1&time_entry%5Bspent_on%5D=2008-03-14'
|
||||
end
|
||||
end
|
||||
|
||||
@ -481,7 +481,7 @@ class TimelogControllerTest < Redmine::ControllerTest
|
||||
},
|
||||
:continue => '1'
|
||||
}
|
||||
assert_redirected_to '/issues/1/time_entries/new?time_entry%5Bactivity_id%5D=11&time_entry%5Bissue_id%5D=1&time_entry%5Bproject_id%5D=&time_entry%5Bspent_on%5D=2008-03-14'
|
||||
assert_redirected_to '/issues/1/time_entries/new?time_entry%5Bactivity_id%5D=11&time_entry%5Bissue_id%5D=1&time_entry%5Bproject_id%5D&time_entry%5Bspent_on%5D=2008-03-14'
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user