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

undefined method '[]' for Nil:NilClass #56

Open
Alonsorossi opened this issue Jun 15, 2023 · 4 comments
Open

undefined method '[]' for Nil:NilClass #56

Alonsorossi opened this issue Jun 15, 2023 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@Alonsorossi
Copy link

After creating an application on the HERE provider, configuring my secrets.yml file, and uncommenting the lines in the decidim.rb file, I installed the module as instructed in the documentation. I created an assembly and assigned it the scopes for geolocation. I activated it in the administration panel to be displayed on the homepage, but still, the map is not being shown to me.

I am working with Decidim 0.27.2 on a local development environment, and for the map provider, I chose HERE, which was recommended by the documentation.

@paulinebessoles paulinebessoles changed the title Problem with the interactive map, it is not displaying undefined method '[]' for Nil:NilClass Jun 19, 2023
@paulinebessoles
Copy link
Collaborator

The 0.27.2 seems to have several fixes not implemented.
image

@Alonsorossi
Copy link
Author

I closed the issue because I was shown the map with the seeds of the module, but when trying to put my geojson it gives the error of undefined method '[]' for Nil:NilClass

@Quentinchampenois
Copy link
Contributor

Hello @Alonsorossi, thank you for your issue !

Thanks to @paulinebessoles we have an idea of the cause and the solution, I will update the module ASAP !

@Quentinchampenois Quentinchampenois added the bug Something isn't working label Jun 20, 2023
@Quentinchampenois Quentinchampenois self-assigned this Jun 20, 2023
@cdm-tao
Copy link

cdm-tao commented Mar 21, 2024

The problem is caused by incorrectly referencing Hash properties with strings/symbols.

One way to fix problem:

  • In .\app\commands\decidim\admin\update_scope.rb, form.geojson properties should be referenced by string in geojson method.
  • In .\app\forms\decidim\admin\scope_form.rb :parsed_geometry property of attribute :geoJson should be of type Hash, and in parsable_json method json should be parsed using symbols, not strings, as property names - ie JSON.parse(geometry, { symbolize_names: true })

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants