プロジェクト

全般

プロフィール

Vote #81769

完了

Filter parameters of Query string do not work when default query is enabled

Admin Redmine さんが3年以上前に追加. 3年以上前に更新.

ステータス:
Closed
優先度:
通常
担当者:
-
カテゴリ:
Filters_59
対象バージョン:
開始日:
2022/05/09
期日:
進捗率:

0%

予定工数:
category_id:
59
version_id:
155
issue_org_id:
36389
author_id:
362529
assigned_to_id:
107353
comments:
10
status_id:
5
tracker_id:
1
plus1:
0
affected_version:
closed_on:
affected_version_id:
ステータス-->[Closed]

説明

Normally, clicking trackers or numbers in the issues tracking in the project's overview will display the issues list filtered by these conditions.
If the default query is enabled, these filters will be ignored and the default query will be applied to display the issues list.


journals

It seems that you should add @without_default@ referenced by @ProjectsController#retrieve_default_query@(source:/trunk/app/controllers/projects_controller.rb#L333) and @IssuesController#retrieve_default_query@(source:/trunk/app/controllers/issues_controller.rb#L489) to the query string.
<pre><code class="ruby">
def retrieve_default_query(use_session)
return if params[:query_id].present?
return if api_request?
return if params[:set_filter] && (params.key?(:op) || params.key?(:f))

if params[:without_default].present?
params[:set_filter] = 1
return
end
</code></pre>

Maybe you need to fix the following:
<pre><code class="shell">
% grep -rn "set_filter" * --exclude-dir={vendor,public,tmp,doc,log,test,config/locales,files,coverage,spec,node_modules}
app/models/mailer.rb:567: :set_filter => 1, :assigned_to_id => 'me',
app/models/mailer.rb:570: :set_filter => 1, :sort => 'due_date:asc',
app/models/query.rb:463: params[:set_filter] = 1
app/controllers/issues_controller.rb:487: return if params[:set_filter] && (params.key?(:op) || params.key?(:f))
app/controllers/issues_controller.rb:490: params[:set_filter] = 1
app/controllers/issues_controller.rb:493: if !params[:set_filter] && use_session && session[:issue_query]
app/controllers/queries_controller.rb:87: redirect_to_items(:set_filter => 1)
app/controllers/projects_controller.rb:331: return if params[:set_filter] && (params.key?(:op) || params.key?(:f))
app/controllers/projects_controller.rb:334: params[:set_filter] = 1
app/views/calendars/show.html.erb:5:<%= hidden_field_tag 'set_filter', '1' %>
app/views/calendars/show.html.erb:29: <%= link_to l(:button_clear), { :project_id => @project, :set_filter => 1 }, :class => 'icon icon-reload' %>
app/views/context_menus/issues.html.erb:146: <li><%= context_menu_link l(:button_filter), _project_issues_path(@project, :set_filter => 1, :status_id => "*", :issue_id => @issue_ids.join(","), :c => @columns),
app/views/context_menus/issues.html.erb:163: <li><%= copy_object_url_link(_project_issues_url(@project, set_filter: 1, status_id: '*', issue_id: @issue_ids.join(','))) %></li>
app/views/projects/show.html.erb:71: <%= link_to tracker.name, project_issues_path(@project, :set_filter => 1, :tracker_id => tracker.id), :title => tracker.description %>
app/views/projects/show.html.erb:74: <%= link_to @open_issues_by_tracker[tracker].to_i, project_issues_path(@project, :set_filter => 1, :tracker_id => tracker.id) %>
app/views/projects/show.html.erb:77: <%= link_to (@total_issues_by_tracker[tracker].to_i - @open_issues_by_tracker[tracker].to_i), project_issues_path(@project, :set_filter => 1, :tracker_id => tracker.id, :status_id => 'c') %>
app/views/projects/show.html.erb:80: <%= link_to @total_issues_by_tracker[tracker].to_i, project_issues_path(@project, :set_filter => 1, :tracker_id => tracker.id, :status_id => '*') %>
app/views/projects/show.html.erb:88: <%= link_to l(:label_issue_view_all), project_issues_path(@project, :set_filter => 1) %>
app/views/versions/_issue_counts.html.erb:18: <%= link_to(count[:group], project_issues_path(version.project, :set_filter => 1, :status_id => '*', :fixed_version_id => version, "#{criteria}_id" => count[:group])) %>
app/views/versions/_issue_counts.html.erb:20: <%= link_to(l(:label_none), project_issues_path(version.project, :set_filter => 1, :status_id => '*', :fixed_version_id => version, "#{criteria}_id" => "!*")) %>
app/views/versions/show.html.erb:23: project_issues_path(@version.project, :set_filter => 1, :status_id => '*', :fixed_version_id => @version.id, :c => [:tracker, :status, :subject, :estimated_hours], :t => [:estimated_hours]) %></td>
app/views/versions/show.html.erb:29: project_time_entries_path(@version.project, :set_filter => 1, :"issue.fixed_version_id" => @version.id) %></td>
app/views/queries/_query_form.html.erb:1:<%= hidden_field_tag 'set_filter', '1' %>
app/views/queries/_query_form.html.erb:57: <%= link_to l(:button_clear), { :set_filter => 1, :sort => '', :project_id => @project }, :class => 'icon icon-reload' %>
app/views/imports/_issues_saved_objects.html.erb:7:<p><%= link_to l(:label_issue_view_all), issues_path(:set_filter => 1, :status_id => '*', :issue_id => saved_objects.map(&:id).join(',')) %></p>
app/views/welcome/robots.text.erb:15:Disallow: <%= url_for(issues_path) %>?*set_filter=
app/views/users/show.html.erb:42: issues_path(:set_filter => 1, :assigned_to_id => assigned_to_ids, :sort => sort_cond) %>
app/views/users/show.html.erb:46: issues_path(:set_filter => 1, :assigned_to_id => assigned_to_ids, :sort => sort_cond) %>
app/views/users/show.html.erb:50: issues_path(:set_filter => 1, :status_id => 'c', :assigned_to_id => assigned_to_ids, :sort => sort_cond) %>
app/views/users/show.html.erb:54: issues_path(:set_filter => 1, :status_id => '*', :assigned_to_id => assigned_to_ids, :sort => sort_cond) %>
app/views/users/show.html.erb:60: issues_path(:set_filter => 1, :author_id => @user.id, :sort => sort_cond) %>
app/views/users/show.html.erb:64: issues_path(:set_filter => 1, :author_id => @user.id, :sort => sort_cond) %>
app/views/users/show.html.erb:68: issues_path(:set_filter => 1, :status_id => 'c', :author_id => @user.id, :sort => sort_cond) %>
app/views/users/show.html.erb:72: issues_path(:set_filter => 1, :status_id => '*', :author_id => @user.id, :sort => sort_cond) %>
app/views/gantts/show.html.erb:11:<%= hidden_field_tag 'set_filter', '1' %>
app/views/gantts/show.html.erb:91: <%= link_to l(:button_clear), { :project_id => @project, :set_filter => 1 },
app/helpers/queries_helper.rb:344: elsif api_request? || params[:set_filter] || !use_session ||
app/helpers/queries_helper.rb:417: tags = hidden_field_tag("set_filter", "1", :id => nil)
app/helpers/queries_helper.rb:475: clear_link_param = {:set_filter => 1, :sort => '', :project_id => @project}
app/helpers/queries_helper.rb:498: def link_to_clear_query(params = {:set_filter => 1, :sort => '', :project_id => @project})
app/helpers/reports_helper.rb:44: parameters = {:set_filter => 1, :subproject_id => '!*', field => (row.id || '!*')}.merge(options)
app/helpers/versions_helper.rb:31: options = {:fixed_version_id => version, :set_filter => 1}.merge(options)
app/helpers/issues_helper.rb:172: link_to(total_issues, issues_path(issues_path_attr.merge({:set_filter => true, :status_id => '*'}))),
app/helpers/issues_helper.rb:180: issues_path(issues_path_attr.merge({:set_filter => true, :status_id => 'c'}))
app/helpers/issues_helper.rb:189: issues_path(issues_path_attr.merge({:set_filter => true, :status_id => 'o'}))
</code></pre>

--------------------------------------------------------------------------------
Maybe it is enough to relax the @set_filter@ if to not include the second condition (@op@ and @f@ params)?
--------------------------------------------------------------------------------
Marius BALTEANU wrote:
> Maybe it is enough to relax the @set_filter@ if to not include the second condition (@op@ and @f@ params)?

I think that it works properly if only @set_filter@ is judged without the second condition. And I don't think the @without_default@ parameter is needed.

--------------------------------------------------------------------------------

--------------------------------------------------------------------------------

--------------------------------------------------------------------------------

--------------------------------------------------------------------------------

--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
If we change as I proposed, then the @without_default@ param doesn't make any sense anymore.

I'll wait for some more feedback before I commit this.
--------------------------------------------------------------------------------
Patch committed.
--------------------------------------------------------------------------------


related_issues

relates,Closed,7360,Issue custom query: default query per instance, project and user
relates,Closed,35795,Settings for global and user default custom ProjectQuery

Admin Redmine さんが3年以上前に更新

  • カテゴリFilters_59 にセット
  • 対象バージョン5.0.0_155 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0