Feature #38301
closedMultiple issue ids in "Related to" filter
Description
Multiple tickets can be specified in the "Parent Task" at custom query.
Feature #30482 Multiple issue ids in "Parent task" filter
Similarly, this patch enable multiple tickets to be specified in the "Related To" field.
(We (@tomokosimi, @sanak and @tohosaku) created this patch in Japan Redmine Patch Meetup 30th (https://redmine-patch.connpass.com/event/274438/) event.)
Files
Updated by Go MAEDA almost 4 years ago
- Target version set to Candidate for next major release
Updated by Go MAEDA over 3 years ago
- Target version changed from Candidate for next major release to 5.1.0
Setting the target version to 5.1.0.
Updated by Go MAEDA over 3 years ago
- Status changed from New to Closed
- Assignee set to Go MAEDA
Committed the patch. Thank you for improving Redmine.
Updated by Go MAEDA over 3 years ago
- Tracker changed from Patch to Feature
Updated by Go MAEDA over 3 years ago
- File 38301-fix-sql-error-when-invalid-value-is-passed.patch 38301-fix-sql-error-when-invalid-value-is-passed.patch added
- Status changed from Closed to Reopened
After r22156, the filter raises an exception when an invalid value like 'ABC' is passed ([Related to] [is] [ABC]). This problem is caused by the generation of IN clauses that do not contain values like this: IN ()
(0.3ms) SELECT COUNT(*) FROM `issues` INNER JOIN `projects` ON `projects`.`id` = `issues`.`project_id` INNER JOIN `issue_statuses` ON `issue_statuses`.`id` = `issues`.`status_id` WHERE (((projects.status <> 9 AND projects.status <> 10 AND EXISTS (SELECT 1 AS one FROM enabled_modules em WHERE em.project_id = projects.id AND em.name='issue_tracking')) AND (((projects.is_public = TRUE AND projects.id NOT IN (SELECT project_id FROM members WHERE user_id IN (6,13))) AND ((issues.is_private = FALSE)))))) AND ((issues.status_id IN (SELECT id FROM issue_statuses WHERE is_closed=FALSE)) AND (issues.id IN (SELECT DISTINCT issue_relations.issue_from_id FROM issue_relations WHERE issue_relations.relation_type = 'relates' AND issue_relations.issue_to_id IN ()) OR (issues.id IN (SELECT DISTINCT issue_relations.issue_to_id FROM issue_relations WHERE issue_relations.relation_type = 'relates' AND issue_relations.issue_from_id IN ()))) AND projects.lft >= 1 AND projects.rgt <= 10) ↳ app/models/issue_query.rb:359:in `issue_count' Query::StatementInvalid: Mysql2::Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')) OR (issues.id IN (SELECT DISTINCT issue_relations.issue_to_id FROM issue_rela' at line 1
The attached patch fixes the issue by returning no results when the value contains no issue number. This is the same behavior as before r22156.