diff --git a/lib/redmine/field_format.rb b/lib/redmine/field_format.rb index 4d168b434b..a2c985faa4 100644 --- a/lib/redmine/field_format.rb +++ b/lib/redmine/field_format.rb @@ -415,7 +415,19 @@ module Redmine end def edit_tag(view, tag_id, tag_name, custom_value, options={}) - view.text_area_tag(tag_name, custom_value.value, options.merge(:id => tag_id, :rows => 8)) + if custom_value.custom_field.type == "IssueCustomField" && custom_value.custom_field.full_width_layout? && custom_value.custom_field.text_formatting == 'full' + content = view.content_tag 'span', :id => "#{tag_id}_and_toolbar" do + view.text_area_tag(tag_name, custom_value.value, + options.merge(:id => tag_id, + :rows => 8, + :cols => 60, + :class => 'wiki-edit' + )) + end + content += view.wikitoolbar_for(tag_id, view.preview_issue_url(:project_id => custom_value.customized.project, :issue_id => custom_value.customized.id)) + else + view.text_area_tag(tag_name, custom_value.value, options.merge(:id => tag_id, :rows => 8)) + end end def bulk_edit_tag(view, tag_id, tag_name, custom_field, objects, value, options={}) diff --git a/test/functional/issues_controller_test.rb b/test/functional/issues_controller_test.rb index 17af8981c8..af67f207f8 100644 --- a/test/functional/issues_controller_test.rb +++ b/test/functional/issues_controller_test.rb @@ -2819,6 +2819,18 @@ class IssuesControllerTest < Redmine::ControllerTest assert_select 'option', text: /#{t.name}/, count: 0 end + def test_new_should_have_wikitoolbar_if_full_width_layout + @request.session[:user_id] = 2 + field = IssueCustomField.create!(:name => 'Long text', :field_format => 'text', :full_width_layout => '1', :text_formatting => 'full', :is_for_all => true, :tracker_ids => [1]) + + get :new, :params => { + :project_id => 1 + } + assert_select "span#issue_custom_field_values_#{field.id}_and_toolbar" do + assert_select "textarea[name='issue[custom_field_values][#{field.id}]']" + end + end + def test_update_form_for_new_issue @request.session[:user_id] = 2 post :new, :params => {