Project

General

Profile

Defect #26863

Updated by Toshi MARUYAMA about 7 years ago

I'm writing a redmine plugin using: IssueQuery 
 where when I want to use : 
 myquery.add_filter("issue_id" , "=", ["123", "124","125"]) 
 I got only the first issue.  
 finally i find the function:sql_for_issue_id_field 

 <pre><code class="ruby"> 
 <pre> 
   def sql_for_issue_id_field(field, operator, value) 
     if operator == "=" 
       # accepts a comma separated list of ids 
       ids = value.first.to_s.scan(/\d+/).map(&:to_i) 
       if ids.present? 
         "#{Issue.table_name}.id IN (#{ids.join(",")})" 
       else 
         "1=0" 
       end 
     else 
       sql_for_field("id", operator, value, Issue.table_name, "id") 
     end 
   end 
 </code></pre> </pre> 

 I seems that the "first" is a error? 

 BTW: i'm new to ruby and redmine.  

Back