Skip to content

Commit 2d5e727

Browse files
committed
Fixed missing project_id issue
1 parent 97b0dea commit 2d5e727

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<% if User.current.allowed_to?(:view_text_blocks, @project) %>
22
<%= select_tag :text_block, text_block_options(@issue), id: 'textblock-select', style: 'display:none; border: 1px solid #e0e2e3; background: #f6f6f6; height: 24px; color: #3d454c; vertical-align: bottom; margin-left: 6px; margin-botton: 0;' %>
33
<%= javascript_include_tag 'text_blocks', plugin: 'redmine_text_blocks' %>
4+
<%= hidden_field_tag :text_block_project_id, @project.id %>
45
<% end %>

assets/javascripts/text_blocks.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,16 @@ var TextBlocks = {
3535
},
3636

3737
reload: function(e){
38+
debugger
39+
var projectId = null
40+
if ($("#issue_project_id").size() > 0) {
41+
projectId = $("#issue_project_id").val()
42+
} else {
43+
projectId = $("#text_block_project_id").val()
44+
}
3845
$("#textblock-select option:gt(0)").remove();
3946
$.ajax({
40-
url: "/text_blocks_by_status/"+$("#issue_status_id").val()+"/"+$("#issue_project_id").val(),
47+
url: "/text_blocks_by_status/" + $("#issue_status_id").val() + "/" + projectId,
4148
method: "GET",
4249
success: function(data){
4350
data.forEach(function(tb){

0 commit comments

Comments
 (0)