Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when using Scoped Admins. #296

Open
rsdeus opened this issue May 2, 2024 · 0 comments
Open

Error when using Scoped Admins. #296

rsdeus opened this issue May 2, 2024 · 0 comments

Comments

@rsdeus
Copy link
Contributor

rsdeus commented May 2, 2024

Describe the bug
When the configuration from Scoped Admins is updated, the following error arises.

NoMethodError (undefined method `with_indifferent_access' for nil:NilClass):
  
decidim-core (0.27.6) lib/decidim/attribute_object/form.rb:82:in `hash_from'
decidim-core (0.27.6) lib/decidim/attribute_object/form.rb:72:in `from_params'
decidim-decidim_awesome (0.10.2) app/forms/decidim/decidim_awesome/admin/config_form.rb:50:in `from_params'
decidim-core (0.27.6) app/controllers/concerns/decidim/form_factory.rb:65:in `from_params'
decidim-decidim_awesome (0.10.2) app/controllers/decidim/decidim_awesome/admin/config_controller.rb:26:in `update'

To Reproduce
Steps to reproduce the behavior:

  1. Go to the 'Decidim Awesome' tab and select 'Scoped Admins'.
  2. Click on 'Add a new "Scoped Admins" group'.
  3. Click on 'Update configuration'.
  4. Check for errors in the log file or browser if in a development environment.

Expected behavior
The configuration update

Desktop (please complete the following information):

  • Debian 12
  • firefox, chrome
  • 0.10.2

Additional context
Modifying the code at line 26 in the config_controller.rb file.
from:
@form = form(ConfigForm).from_params(params[:config])
to:
@form = form(ConfigForm).from_params(params[:config] || {})

Solves the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant