Describe the bug
There's a crash when clicking "Import CSV" from the accountability resutls page in the admin panel.
The crash happens when the component is created into an assembly.
To Reproduce
Steps to reproduce the behavior:
- In the admin, go to the list of results of an accountability component in an assembly
- Click on 'Import CSV'
- See error
Expected behavior
When clicking in the "Import CSV" button I expect the application to show a form asking for the file to import, and explaining the expected format.
Stacktrace
Completed 500 Internal Server Error in 12ms (ActiveRecord: 0.3ms | Allocations: 8245)
NoMethodError (undefined method `components' for nil:NilClass):
/home/oliver/prog/decidim/fork_coditramuntana/decidim-accountability/app/controllers/decidim/accountability/admin/import_results_controller.rb:25:in `current_component'
/home/oliver/prog/decidim/fork_coditramuntana/decidim-admin/app/controllers/decidim/admin/components/base_controller.rb:57:in `current_participatory_space'
/home/oliver/prog/decidim/fork_coditramuntana/decidim-admin/app/controllers/concerns/decidim/admin/participatory_space_admin_context.rb:47:in `authorize_participatory_space'
activesupport (6.0.3.7) lib/active_support/callbacks.rb:428:in `block in make_lambda'
activesupport (6.0.3.7) lib/active_support/callbacks.rb:200:in `block (2 levels) in halting'
actionpack (6.0.3.7) lib/abstract_controller/callbacks.rb:34:in `block (2 levels) in <module:Callbacks>'
activesupport (6.0.3.7) lib/active_support/callbacks.rb:201:in `block in halting'
activesupport (6.0.3.7) lib/active_support/callbacks.rb:513:in `block in invoke_before'
activesupport (6.0.3.7) lib/active_support/callbacks.rb:513:in `each'
activesupport (6.0.3.7) lib/active_support/callbacks.rb:513:in `invoke_before'
activesupport (6.0.3.7) lib/active_support/callbacks.rb:110:in `block in run_callbacks'
activesupport (6.0.3.7) lib/active_support/core_ext/time/zones.rb:66:in `use_zone'
/home/oliver/prog/decidim/fork_coditramuntana/decidim-core/app/controllers/concerns/decidim/use_organization_time_zone.rb:21:in `use_organization_time_zone'
activesupport (6.0.3.7) lib/active_support/callbacks.rb:121:in `block in run_callbacks'
i18n (1.8.10) lib/i18n.rb:314:in `with_locale'
/home/oliver/prog/decidim/fork_coditramuntana/decidim-core/app/controllers/concerns/decidim/locale_switcher.rb:24:in `switch_locale'
Describe the bug
There's a crash when clicking "Import CSV" from the accountability resutls page in the admin panel.
The crash happens when the component is created into an assembly.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
When clicking in the "Import CSV" button I expect the application to show a form asking for the file to import, and explaining the expected format.
Stacktrace