sergeyirl / redmine_loader

Project plan loader plugin for redmine
redmine_loader
BSD 3-Clause "New" or "Revised" License
9 stars 5 forks source link

Exporting results in error "NoMethodError (undefined method `to_time' for nil:NilClass)" #6

Open cforce opened 12 years ago

cforce commented 12 years ago

I, [2011-10-19T15:17:12.535035 #4200] INFO -- :

Processing LoaderController#export (for 172.25.252.11 at 2011-10-19 15:17:12) [POST] I, [2011-10-19T15:17:12.535182 #4200] INFO -- : Parameters: {"project_id"=>"105", "action"=>"export", "authenticity_token"=>"ZwyelCuZL2eqMe0uAgGAVjDAyGok7RtwA60uTUJOmjQ=", "controller"=>"loader", "export"=>"Export Issue"} D, [2011-10-19T15:17:12.536731 #4200] DEBUG -- : SQL (0.6ms) SELECT max(settings.updated_on) AS max_updated_on FROM settings  D, [2011-10-19T15:17:12.537958 #4200] DEBUG -- : User Load (0.3ms) SELECT * FROM users WHERE (users.id = 3) AND (users.status = 1) AND ( (users.type = 'User' OR users.type = 'AnonymousUser' ) )  D, [2011-10-19T15:17:12.539045 #4200] DEBUG -- : Project Load (0.3ms) SELECT * FROM projects WHERE (projects.id = 105)  D, [2011-10-19T15:17:12.540792 #4200] DEBUG -- : Issue Load (0.9ms) SELECT * FROM issues WHERE (issues.project_id = 105) ORDER BY id, issues.created_on DESC D, [2011-10-19T15:17:12.545138 #4200] DEBUG -- : IssueStatus Load (0.5ms) SELECT * FROM issue_statuses WHERE (issue_statuses.id IN (14,9,1,5))  D, [2011-10-19T15:17:12.547021 #4200] DEBUG -- : Tracker Load (0.3ms) SELECT * FROM trackers WHERE (trackers.id IN (1,2,3,4))  D, [2011-10-19T15:17:12.552330 #4200] DEBUG -- : Issue Load (3.8ms) SELECT * FROM issues WHERE (parent_id=872) LIMIT 1 D, [2011-10-19T15:17:12.553178 #4200] DEBUG -- : IssueRelation Load (0.3ms) SELECT * FROM issue_relations WHERE (issue_to_id =872 AND relation_type = 'precedes')  D, [2011-10-19T15:17:12.557940 #4200] DEBUG -- : Issue Load (3.8ms) SELECT * FROM issues WHERE (parent_id=874) LIMIT 1 D, [2011-10-19T15:17:12.558893 #4200] DEBUG -- : IssueRelation Load (0.3ms) SELECT * FROM issue_relations WHERE (issue_to_id =874 AND relation_type = 'precedes')  F, [2011-10-19T15:17:12.562664 #4200] FATAL -- : NoMethodError (undefined method to_time' for nil:NilClass): vendor/plugins/redmine_loader/app/controllers/loader_controller.rb:365:ingenerate_xml' vendor/plugins/redmine_loader/app/controllers/loader_controller.rb:357:in generate_xml' vendor/plugins/redmine_loader/app/controllers/loader_controller.rb:356:ineach' vendor/plugins/redmine_loader/app/controllers/loader_controller.rb:356:in generate_xml' vendor/plugins/redmine_loader/app/controllers/loader_controller.rb:345:ingenerate_xml' vendor/plugins/redmine_loader/app/controllers/loader_controller.rb:344:in generate_xml' vendor/plugins/redmine_loader/app/controllers/loader_controller.rb:328:inexport' passenger (3.0.8) lib/phusion_passenger/rack/request_handler.rb:96:in process_request' passenger (3.0.8) lib/phusion_passenger/abstract_request_handler.rb:513:inaccept_and_process_next_request' passenger (3.0.8) lib/phusion_passenger/abstract_request_handler.rb:274:in main_loop' passenger (3.0.8) lib/phusion_passenger/classic_rails/application_spawner.rb:321:instart_request_handler' passenger (3.0.8) lib/phusion_passenger/classic_rails/application_spawner.rb:275:in send' passenger (3.0.8) lib/phusion_passenger/classic_rails/application_spawner.rb:275:inhandle_spawn_application' passenger (3.0.8) lib/phusion_passenger/utils.rb:479:in safe_fork' passenger (3.0.8) lib/phusion_passenger/classic_rails/application_spawner.rb:270:inhandle_spawn_application' passenger (3.0.8) lib/phusion_passenger/abstract_server.rb:357:in __send__' passenger (3.0.8) lib/phusion_passenger/abstract_server.rb:357:inserver_main_loop' passenger (3.0.8) lib/phusion_passenger/abstract_server.rb:206:in start_synchronously' passenger (3.0.8) lib/phusion_passenger/abstract_server.rb:180:instart' passenger (3.0.8) lib/phusion_passenger/classic_rails/application_spawner.rb:149:in start' passenger (3.0.8) lib/phusion_passenger/spawn_manager.rb:219:inspawn_rails_application' passenger (3.0.8) lib/phusion_passenger/abstract_server_collection.rb:132:in lookup_or_add' passenger (3.0.8) lib/phusion_passenger/spawn_manager.rb:214:inspawn_rails_application' passenger (3.0.8) lib/phusion_passenger/abstract_server_collection.rb:82:in synchronize' passenger (3.0.8) lib/phusion_passenger/abstract_server_collection.rb:79:insynchronize' passenger (3.0.8) lib/phusion_passenger/spawn_manager.rb:213:in spawn_rails_application' passenger (3.0.8) lib/phusion_passenger/spawn_manager.rb:132:inspawn_application' passenger (3.0.8) lib/phusion_passenger/spawn_manager.rb:275:in handle_spawn_application' passenger (3.0.8) lib/phusion_passenger/abstract_server.rb:357:insend' passenger (3.0.8) lib/phusion_passenger/abstract_server.rb:357:in server_main_loop' passenger (3.0.8) lib/phusion_passenger/abstract_server.rb:206:instart_synchronously' passenger (3.0.8) helper-scripts/passenger-spawn-server:99

I, [2011-10-19T15:17:12.564301 #4200] INFO -- : Rendering /opt/redmine-1.2.1d2/public/500.html (500 Internal Server Error)

cforce commented 12 years ago

I located the bugs in loader_controller.rb Seems as version.effective_date, issue.start_date and issue.due_date get tot checkd if they are set before time conversion. I added an "if issue.start_date" or if "issue.due_date" or "if version.effective_date" behind these lines. to check before. No i can export an xml. But am not sure if Ms Project will allow xml files without that xml elements. So far these attributes are not mandatory in redmine, so an exporter can expect them to be set. It must be checked and maybe setting to "0" will be better for Ms project import compatability than not set them in the xml. Maybe ist not possible at all to import task or versions wthout dates, so this items muts be skipped completly, but that would be bad to sync status of both tools.

y8 commented 12 years ago

You can try my fork.

Unfortunately, there still many issues with MS Project itself, we can't make it to import XML properly.

cforce commented 12 years ago

The bugs i reported are on ur fork. Would be great if you enable githubs issue module so i can report and push there.

cforce commented 12 years ago

Which bugs are open. Please write a list, so we know what shall be fixed