Project

General

Profile

Defect #1143

hudson plugin: empty filter attributes results in "undefined" filter value

Added by cforce cforce over 6 years ago. Updated over 6 years ago.

Status:
新規(New)
Priority:
通常(Normal)
Target version:
-
Start date:
12/10/2012
Due date:
% Done:

0%

Estimated time:

Description

Btw. i already chekced drop down list in rendered hmtl view against pattern of "name": and there are complete, means alls entries with name <> empty and no more.

Then i found the last two entries without name attrib..

,"hudson_job":{"type":"list_optional","values":[]},"hudson_build":{"type":"integer"}};
var labelDayPlural = "Tage";
$(document).ready(function(){
  initFilters();
  addFilter("status_id", "o", [""]);
});

The hudson plugins seems to extens the filters without name, so that could be the problem. I will write a bug report to the author.

see http://www.redmine.org/issues/12525


Files

query_patch.rb (8.63 KB) query_patch.rb cforce cforce, 01/18/2013 02:03 AM

History

#1

Updated by cforce cforce over 6 years ago

The problem is missing :name (see last line) attrib in filter

See my example:

 def available_filters_extended
  unless @available_filters 
    available_filters_original.merge!({ 'exmpleattrib' => {
       :name   => l(:exmpleattrib_label),

#2

Updated by cforce cforce over 6 years ago

Change code (untested) in /lib/query_patch.rb in def hudson_filters

@hudson_filters << HudsonQueryFilter.new("hudson_job",
                                { :name   => l(:hudson_job), :type => :list_optional, :order => @available_filters.size + 1,
                                  :values => HudsonJob.find(:all, :conditions => ["#{HudsonJob.table_name}.project_id = ?", project.id],
                                              :order => "#{HudsonJob.table_name}.name").collect {|job|
                                              next unless hudson.settings.job_include?(job.name)
                                              [job.name, job.id.to_s]
                                            }
                                },
                                HudsonJob.table_name,
                                "id")
        @hudson_filters << HudsonQueryFilter.new("hudson_build",
                                { :name   => l(:hudson_build), :type => :integer, :order => @available_filters.size + 2 },
                                HudsonBuild.table_name,
                                "number")

        return @hudson_filters

#3

Updated by Haru Iida over 6 years ago

  • Project changed from r-labs to Hudson
  • Assignee set to Toshiyuki Ando
#4

Updated by cforce cforce over 6 years ago

This ist still not fixed although i provided a working fix! Please integrate this into ur code soon.

#5

Updated by cforce cforce over 6 years ago

Fixed file with correct labels

Also available in: Atom PDF