Closed sussexrick closed 11 years ago
I have the same issue here - query_id seems to be an invalid number...
my knowledge or ruby and redmine code is very small at this point, so I can't help pinpoint it... seems like the id
used by the query presenter is not actually the ID from the originating query (?)
[edit]
Ok, so it would seem (from my embryonic understanding) that id
in QueryPresenter can mean two things - there seems to be a method as well as an attribute.
Using id
directly seems to yield some sort of unique instance id, while using self[:id]
actually returns the query ID.
I've updated the appropriate references in the query presenter and it fixes the problem for me.
[edit] I've forked to make my changes and made a pull request with the fix.
I have merged the pull request. Thanks to @themaze75
My environment is Windows 2008 R2 / Ruby 1.8.7 / Rails 3.2.13 / Redmine 2.3.2 / Thin 1.5.1.
This is the first time I've tried a Redmine plugin so maybe I've missed some setup. I downloaded the ZIP from github and extracted the contents inside the plugins folder, then started Redmine from the command line.
When adding a custom query, the "view all issues", page size options and "extended view" links don't work for me.
View all issues goes to http://localhost:3000/issues?query_id=163927404 when it should go to http://localhost:3000/issues?query_id=90, therefore Redmine displays a 404.
The others briefly display a Loading indicator but nothing happens. The command line output also shows a 404 for those. For example, here's the output when clicking on "Extended view":
Started PUT "/my/update_query_block/163927404?query%5Bcompact_view%5D=false" for 127.0.0.1 at Wed Jul 31 11:35:27 +0100 2013 Processing by MyController#update_query_block as JS Parameters: {"query_id"=>"163927404", "query"=>{"compact_view"=>"false"}} ←[1m←[36m (3.0ms)←[0m ←[1mEXEC sp_executesql N'SELECT MAX([settings].[updated _on]) AS max_id FROM [settings]'←[0m ←[1m←[35mUser Load (2.0ms)←[0m EXEC sp_executesql N'SELECT TOP (1) [users].* FROM [users] WHERE [users].[type] IN (N''User'', N''AnonymousUser'') AND [users] .[status] = 1 AND [users].[id] = @0', N'@0 int', @0 = 18 [["id", 18]] Current user: richardm (id=18) ←[1m←[36mSQL (71.0ms)←[0m ←[1mEXEC sp_executesql N'SELECT [queries].[id] AS t 0_r0, [queries].[project_id] AS t0_r1, [queries].[name] AS t0_r2, [queries].[fil ters] AS t0_r3, [queries].[user_id] AS t0_r4, [queries].[is_public] AS t0_r5, [q ueries].[column_names] AS t0_r6, [queries].[sort_criteria] AS t0_r7, [queries].[ group_by] AS t0_r8, [queries].[type] AS t0_r9, [projects].[id] AS t1_r0, [projec ts].[name] AS t1_r1, [projects].[description] AS t1_r2, [projects].[homepage] AS t1_r3, [projects].[is_public] AS t1_r4, [projects].[parent_id] AS t1_r5, [proje cts].[created_on] AS t1_r6, [projects].[updated_on] AS t1_r7, [projects].[identi fier] AS t1_r8, [projects].[status] AS t1_r9, [projects].[lft] AS t1_r10, [proje cts].[rgt] AS t1_r11, [projects].[inherit_members] AS t1_r12 FROM [queries] LEFT OUTER JOIN [projects] ON [projects].[id] = [queries].[project_id] WHERE [querie s].[type] IN (N''IssueQuery'') AND ((queries.project_id IS NULL OR (projects.sta tus <> 9 AND projects.id IN (SELECT em.project_id FROM enabled_modules em WHERE em.name=''issue_tracking''))) AND (queries.is_public = 1 OR queries.user_id = 18 )) AND (queries.user_id = 18) ORDER BY queries.name ASC'←[0m ←[1m←[35mSQL (11.0ms)←[0m EXEC sp_executesql N'SELECT [queries].[id] AS t0_r0 , [queries].[project_id] AS t0_r1, [queries].[name] AS t0_r2, [queries].[filters ] AS t0_r3, [queries].[user_id] AS t0_r4, [queries].[is_public] AS t0_r5, [queri es].[column_names] AS t0_r6, [queries].[sort_criteria] AS t0_r7, [queries].[grou p_by] AS t0_r8, [queries].[type] AS t0_r9, [projects].[id] AS t1_r0, [projects]. [name] AS t1_r1, [projects].[description] AS t1r2, [projects].[homepage] AS t1 r3, [projects].[is_public] AS t1_r4, [projects].[parent_id] AS t1_r5, [projects] .[created_on] AS t1_r6, [projects].[updated_on] AS t1_r7, [projects].[identifier ] AS t1_r8, [projects].[status] AS t1_r9, [projects].[lft] AS t1_r10, [projects] .[rgt] AS t1_r11, [projects].[inherit_members] AS t1_r12 FROM [queries] LEFT OUT ER JOIN [projects] ON [projects].[id] = [queries].[project_id] WHERE [queries].[ type] IN (N''IssueQuery'') AND ((queries.project_id IS NULL OR (projects.status <> 9 AND projects.id IN (SELECT em.project_id FROM enabled_modules em WHERE em.n ame=''issue_tracking''))) AND (queries.is_public = 1 OR queries.user_id = 18)) A ND (queries.user_id <> 18) ORDER BY queries.name ASC' Rendered common/error.html.erb (1.0ms) Completed 404 Not Found in 122ms (Views: 8.0ms | ActiveRecord: 87.0ms)