openplans / shareabouts

Shareabouts is a mapping application for crowdsourced info gathering.
GNU General Public License v3.0
276 stars 150 forks source link

Activity panel blank with JS error #200

Closed BenSturmfels closed 3 years ago

BenSturmfels commented 3 years ago

Thanks for all your work on Shareabouts!

I'm setting up a new site using master but seeing a blank activity panel displayed, when I was expecting to see the existing place submissions show up.

I'm seeing the following JavaScript error in the console and the normal poll requests to /api/actions don't seem to be running either. I've tried a couple of different web browsers.

Uncaught TypeError: this.collection.metadata is undefined
    complete http://127.0.0.1:8001/static/js/views/activity-view.js:59
    jQuery 4
activity-view.js:59:9

2021-02-05_16-42

This is the master branch of both shareabouts-api and shareabouts, using the stock defaultflavor with activity.enabled: true.

Any thoughts? I'm not so familiar with the Backbone so finding this tricky to troubleshoot.

BenSturmfels commented 3 years ago

After a lot of diving, this turned out to be a shareabouts-api configuration issue and nothing to do with the frontend or Backbone.

My local_settings.py was overriding the REST_FRAMEWORK configuration and specifying the old PAGINATE_BY key that djangorestframework replaced with PAGE_SIZE some time after version 3.1. The result was that pagination was not being used at all and hence no metadata key in the API data.