Project

General

Profile

Actions

Defect #42458

closed

"For all projects" checkbox should be disabled when editing an existing query in which the checkbox is already checked

Added by [Agileware] nusohiro 12 days ago. Updated 5 days ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Issues
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Fixed
Affected version:

Description

Currently, when editing an existing query that is set for all projects (global query), users can uncheck the "For all projects" checkbox, but this change is not actually saved when the form is submitted. This inconsistency between the UI and the actual behavior can lead to confusion. Even though the checkbox appears to be changeable in the interface, the system silently ignores this change when the Save button is pressed, which creates a misleading user experience.

This patch modifies the query form to disable the "For all projects" checkbox when editing an existing query where this option is already checked (where @query.project.nil? is true and @query.new_record? is false). This makes the UI behavior consistent with the actual system behavior and prevents users from attempting to make changes that won't be saved.

The implementation adds a simple conditional to the checkbox's disabled attribute:

<%= check_box_tag 'query_is_for_all', 1, @query.project.nil?, :disabled => (!@query.new_record? && @query.project.nil?), :class => (User.current.admin? ? '' : 'disable-unless-private') %>

This ensures that:
  • For new queries (both project-specific and global), the checkbox remains enabled
  • For existing queries where "For all projects" is checked, the checkbox is disabled and cannot be unchecked
  • For existing project-specific queries, the checkbox remains enabled

Files


Related issues

Related to Redmine - Defect #28033: Unable to turn off "For all projects" flag of custom queriesNew

Actions
Actions

Also available in: Atom PDF