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

SAMBRO Homepage 500 Error #1344

Closed
tewksbg opened this issue Feb 3, 2017 · 2 comments · Fixed by #1521
Closed

SAMBRO Homepage 500 Error #1344

tewksbg opened this issue Feb 3, 2017 · 2 comments · Fixed by #1521

Comments

@tewksbg
Copy link

tewksbg commented Feb 3, 2017

Error trace

Traceback (most recent call last):
  File "/var/www/web2py/gluon/restricted.py", line 227, in restricted
    exec ccode in environment
  File "file stream", line 425, in <module>
  File "/var/www/web2py/gluon/globals.py", line 430, in write
    self.body.write(xmlescape(data))
  File "/var/www/web2py/gluon/html.py", line 131, in xmlescape
    return data.xml()
  File "applications/eden/modules/s3/s3gis.py", line 7098, in xml
    self._setup()
  File "applications/eden/modules/s3/s3gis.py", line 6913, in _setup
    options["feature_resources"] = addFeatureResources(feature_resources)
  File "applications/eden/modules/s3/s3gis.py", line 7515, in addFeatureResources
    url = layer["url"]
KeyError: 'url'
@nursix
Copy link
Member

nursix commented Jan 23, 2018

This happens due to missing map layer configurations - either because they have been deleted or not added to the database in the first place. This configuration error is logged, but no proper compensatory action is taken:
https://github.com/sahana/eden/blob/master/modules/templates/SAMBRO/controllers.py#L51

It would make sense to skip the entire map configuration (i.e. not call show_map at all) rather than just setting layer_id to None, and display a warning message to the user.

@nursix
Copy link
Member

nursix commented Jan 23, 2018

Probably something for @waidyanatha ("good first issue")

@nursix nursix closed this as completed Jan 23, 2018
@nursix nursix reopened this Jan 23, 2018
hallamoore added a commit to hallamoore/eden that referenced this issue Nov 19, 2019
flavour pushed a commit that referenced this issue Nov 20, 2019
* SAMBRO: Display error DIV if map layer is missing

Fixes #1344

* Wrap error message with T()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants