extend field of type "number" is not initialized and crashes when checked against other numbers #125

Open
MR73 opened this Issue Nov 13, 2013 · 0 comments

Projects

None yet

1 participant

@MR73
MR73 commented Nov 13, 2013

When adding a custom field of type number to a task and then using this field as a criteria within hidetask, the tj3 application crashes when a task with an uninitialized custom number field is check against a number:

In short:

extend task {
    number Oops "Oops"
}
task test_task1 "Task 1: Uninitialized extended fields" {
}

and then

taskreport test2 "Test2" {
    formats html
    columns
        Oops
    hidetask (plan.Oops = 0)
}

crashes tj3.

Full example project:

project your_project_id "Test"  2013-11-01-0:00--0500 +2m {
    timezone "Europe/Berlin"
    timeformat "%Y-%m-%d"
    numberformat "-" "" "," "." 1
    currencyformat "(" ")" "," "." 0
    currency "EUR"

    extend task {
        number Oops "Oops"
        text Comment "Comment"
    }
}

copyright "some guy"

task test_project "Test Project" {
    
    task test_task1 "Task 1: Uninitialized extended fields" {
        
        #all extended fields are not initialized in this task
        
    }
    task test_task2 "Task 2: Extended fields with values" {
        
        Comment "Hello"
        Oops 100
    }
}


# the following report contains both tasks
taskreport test1 "Test1" {
    formats html
        columns
        name,
        Oops, # I would expect Oops to be "0" for test_task1 instead the cell is empty
        Comment
}

# the following report should contain only task 2, instead it crashes (see terminal below)
taskreport test2 "Test2" {
    formats html
        columns
        name,
        Oops,
        Comment
        hidetask (plan.Oops = 0)
        sorttasks Oops.down
}


/*
Fatal: undefined method `-@' for nil:NilClass                ...
C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/taskjuggler-3.5.0/lib/taskjuggler/PropertyList.rb:298:in `block (2 levels) in sortInternal'
C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/taskjuggler-3.5.0/lib/taskjuggler/PropertyList.rb:265:in `times'
C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/taskjuggler-3.5.0/lib/taskjuggler/PropertyList.rb:265:in `block in sortInternal'
C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/taskjuggler-3.5.0/lib/taskjuggler/PropertyList.rb:263:in `sort!'
C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/taskjuggler-3.5.0/lib/taskjuggler/PropertyList.rb:263:in `sortInternal'
C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/taskjuggler-3.5.0/lib/taskjuggler/PropertyList.rb:178:in `sort!'
C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/taskjuggler-3.5.0/lib/taskjuggler/reports/TaskListRE.rb:46:in `generateIntermediateFormat'
C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/taskjuggler-3.5.0/lib/taskjuggler/reports/Report.rb:148:in `generateIntermediateFormat'
C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/taskjuggler-3.5.0/lib/taskjuggler/reports/Report.rb:73:in `generate'
C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/taskjuggler-3.5.0/lib/taskjuggler/Project.rb:727:in `block in generateReports'
C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/taskjuggler-3.5.0/lib/taskjuggler/PropertySet.rb:297:in `block in each'
C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/taskjuggler-3.5.0/lib/taskjuggler/PropertySet.rb:296:in `each'
C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/taskjuggler-3.5.0/lib/taskjuggler/PropertySet.rb:296:in `each'
C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/taskjuggler-3.5.0/lib/taskjuggler/Project.rb:720:in `generateReports'
C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/taskjuggler-3.5.0/lib/taskjuggler/TaskJuggler.rb:158:in `generateReports'
C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/taskjuggler-3.5.0/lib/taskjuggler/apps/Tj3.rb:214:in `appMain'
C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/taskjuggler-3.5.0/lib/taskjuggler/Tj3AppBase.rb:146:in `main'
C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/taskjuggler-3.5.0/lib/tj3.rb:16:in `'
C:/Ruby200-x64/lib/ruby/site_ruby/2.0.0/rubygems/custom_require.rb:55:in `require'
C:/Ruby200-x64/lib/ruby/site_ruby/2.0.0/rubygems/custom_require.rb:55:in `require'
C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/taskjuggler-3.5.0/bin/tj3:4:in `'
C:/Ruby200-x64/bin/tj3:23:in `load'
C:/Ruby200-x64/bin/tj3:23:in `'

*******************************************************************************
You have triggered a bug in TaskJuggler version 3.5.0!
Please see the user manual on how to get this bug fixed!
http://www.taskjuggler.org/tj3/manual/Reporting_Bugs.html#Reporting_Bugs_and_Feature_Requests
*******************************************************************************

C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/taskjuggler-3.5.0/lib/taskjuggler/MessageHandler.rb:301:in `addMessage': RuntimeError (RuntimeError)
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/taskjuggler-3.5.0/lib/taskjuggler/MessageHandler.rb:190:in `fatal'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/taskjuggler-3.5.0/lib/taskjuggler/MessageHandler.rb:312:in `fatal'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/taskjuggler-3.5.0/lib/taskjuggler/Tj3AppBase.rb:161:in `rescue in main'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/taskjuggler-3.5.0/lib/taskjuggler/Tj3AppBase.rb:127:in `main'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/taskjuggler-3.5.0/lib/tj3.rb:16:in `'
from C:/Ruby200-x64/lib/ruby/site_ruby/2.0.0/rubygems/custom_require.rb:55:in `require'
from C:/Ruby200-x64/lib/ruby/site_ruby/2.0.0/rubygems/custom_require.rb:55:in `require'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/taskjuggler-3.5.0/bin/tj3:4:in `'
from C:/Ruby200-x64/bin/tj3:23:in `load'
from C:/Ruby200-x64/bin/tj3:23:in `'
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment