I haven't been able to look deeply into the code, but here are the steps to reproduce:
Considering the fact that this is tested code (specifically @QueriesControllerTest#test_create_project_query_from_gantt@ tests the use-case I use above) it makes sense to assume the error is encapsulated in the test because it doesn't fail.
I think this might be a problem with the correct passing of the @:draw_relations@ parameter, because that is fixed in the test and missing in the actual request (see log snippets).
Started GET "/issues/gantt" for 192.168.31.1 at 2013-10-21 04:32:30 +0200
Processing by GanttsController#show as HTML
Rendered queries/_filters.html.erb (43.2ms)
Rendered issues/_sidebar.html.erb (43.9ms)
Rendered gantts/show.html.erb within layouts/base (1991.9ms)
Completed 200 OK in 2249ms (Views: 1806.4ms | ActiveRecord: 313.2ms)
Started GET "/issues/gantt?utf8=%E2%9C%93&set_filter=1&gantt=1&f%5B%5D=status_id&op%5Bstatus_id%5D=o&f%5B%5D=&query%5Bdraw_relations%5D=0&query%5Bdraw_progress_line%5D=0&months=4&month=10&year=2013&zoom=2" for 192.168.31.1 at 2013-10-21 04:32:48 +0200
Processing by GanttsController#show as HTML
Parameters: {"utf8"=>"✓", "set_filter"=>"1", "gantt"=>"1", "f"=>["status_id", ""], "op"=>{"status_id"=>"o"}, "query"=>{"draw_relations"=>"0", "draw_progress_line"=>"0"}, "months"=>"4", "month"=>"10", "year"=>"2013", "zoom"=>"2"}
Current user: admin (id=1)
Rendered queries/_filters.html.erb (67.2ms)
Rendered issues/_sidebar.html.erb (116.0ms)
Rendered gantts/show.html.erb within layouts/base (2870.6ms)
Completed 200 OK in 3420ms (Views: 2738.7ms | ActiveRecord: 426.7ms)
Started GET "/queries/new?utf8=%E2%9C%93&set_filter=1&gantt=1&f%5B%5D=status_id&op%5Bstatus_id%5D=o&f%5B%5D=&query%5Bdraw_relations%5D=0&query%5Bdraw_progress_line%5D=0&months=4&month=10&year=2013&zoom=2" for 192.168.31.1 at 2013-10-21 04:32:58 +0200
Processing by QueriesController#new as HTML
Parameters: {"utf8"=>"✓", "set_filter"=>"1", "gantt"=>"1", "f"=>["status_id", ""], "op"=>{"status_id"=>"o"}, "query"=>{"draw_relations"=>"0", "draw_progress_line"=>"0"}, "months"=>"4", "month"=>"10", "year"=>"2013", "zoom"=>"2"}
Current user: admin (id=1)
Rendered queries/_filters.html.erb (104.9ms)
Rendered queries/_columns.html.erb (44.1ms)
Rendered queries/_form.html.erb (315.2ms)
Rendered queries/new.html.erb within layouts/base (320.3ms)
Completed 200 OK in 801ms (Views: 364.5ms | ActiveRecord: 127.8ms)
Started POST "/queries" for 192.168.31.1 at 2013-10-21 04:33:25 +0200
Processing by QueriesController#create as HTML
Parameters: {"utf8"=>"✓", "gantt"=>"1", "query"=>{"name"=>"Gantt without related issues", "visibility"=>"0", "role_ids"=>[""], "group_by"=>"", "sort_criteria"=>{"0"=>["", ""], "1"=>["", ""], "2"=>["", ""]}}, "query_is_for_all"=>"1", "default_columns"=>"1", "f"=>["status_id", ""], "op"=>{"status_id"=>"o"}, "c"=>["project", "tracker", "status", "priority", "subject", "assigned_to", "updated_on"], "commit"=>"Save"}
Current user: admin (id=1)
Redirected to http://redmine-trunk.local.lan/issues/gantt?query_id=15
Completed 302 Found in 250ms (ActiveRecord: 100.2ms)
Started GET "/issues/gantt?query_id=15" for 192.168.31.1 at 2013-10-21 04:33:26 +0200
Processing by GanttsController#show as HTML
Parameters: {"query_id"=>"15"}
Current user: admin (id=1)
Rendered queries/_filters.html.erb (40.8ms)
Rendered issues/_sidebar.html.erb (42.8ms)
Rendered gantts/show.html.erb within layouts/base (1483.3ms)
Completed 200 OK in 1746ms (Views: 1334.5ms | ActiveRecord: 268.2ms)