Project

General

Profile

Actions

Feature #38301

closed

Multiple issue ids in "Related to" filter

Added by Ko Nagase about 1 year ago. Updated 9 months ago.

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

0%

Estimated time:
Resolution:

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 (Tomoko Shimizu, Ko Nagase and Takashi Kato) created this patch in Japan Redmine Patch Meetup 30th (https://redmine-patch.connpass.com/event/274438/) event.)


Files

Actions #2

Updated by Go MAEDA about 1 year ago

  • Target version set to Candidate for next major release
Actions #3

Updated by Go MAEDA about 1 year ago

  • Target version changed from Candidate for next major release to 5.1.0

Setting the target version to 5.1.0.

Actions #4

Updated by Go MAEDA 12 months ago

  • Status changed from New to Closed
  • Assignee set to Go MAEDA

Committed the patch. Thank you for improving Redmine.

Actions #5

Updated by Go MAEDA 12 months ago

  • Tracker changed from Patch to Feature
Actions #6

Updated by Go MAEDA 9 months ago

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.

Actions #7

Updated by Go MAEDA 9 months ago

  • Status changed from Reopened to Closed

Fixed the issue described in #note-6 in r22256.

Actions

Also available in: Atom PDF