Skip to content

Remove filters from map tap nearby plot request#279

Merged
jwalgran merged 1 commit intoOpenTreeMap:masterfrom
jwalgran:feature/jcw/dont-send-filter-when-finding-plot
Feb 23, 2016
Merged

Remove filters from map tap nearby plot request#279
jwalgran merged 1 commit intoOpenTreeMap:masterfrom
jwalgran:feature/jcw/dont-send-filter-when-finding-plot

Conversation

@jwalgran
Copy link
Copy Markdown
Contributor

The /location/lat,lng/plots API endpoint ignores any filters that are passed along with the request:

https://github.com/OpenTreeMap/otm-core/blob/983ffcdb0a226fc9bd6ab1fc3e3f42e47ed9e5ba/opentreemap/api/plots.py#L39

The filters have been ignored since the initial creation of the OTM2 API endpoint.

OpenTreeMap/otm-core@b25c3b9


Testing

If you run the application in the simulator, apply a filter, and then tap the map, you should see in the NSLog output that the request is sent without a q= parameter.

The specific bug resolved by this commit can be tested for by following the reproduction steps from #278:

On the website:

  1. Create a custom planting site field named "Test Field". Make it editable and filterable on mobile.
  2. Add a planting site and set the value of "Test Field"

On the iOS app:

  1. Find the newly created planting site and verify that you can tap it and see its detail popup. Tap away from the planting site to clear the selection.
  2. Filter the map by "Test Field" so that it will match the value used when creating the planting site.
  3. Tap the planting site, which should still be visible because it matches the filter.

On the current master branch, the popup will not appear because the filters passed along to the endpoint are not encoded using a method consistent with what the server expects, resulting in a 400 response.


Connects to #278

The /location/lat,lng/plots API endpoint ignores any filters that are
passed along with the request:

https://github.com/OpenTreeMap/otm-core/blob/983ffcdb0a226fc9bd6ab1fc3e3f42e47ed9e5ba/opentreemap/api/plots.py#L39

The filters have been ignored since the initial creation of the OTM2 API
endpoint.

OpenTreeMap/otm-core@b25c3b9
@RickMohr
Copy link
Copy Markdown
Contributor

+1, tested. Good sleuthing.

@RickMohr RickMohr assigned jwalgran and unassigned RickMohr Feb 23, 2016
jwalgran added a commit that referenced this pull request Feb 23, 2016
…en-finding-plot

Remove filters from map tap nearby plot request
@jwalgran jwalgran merged commit 52ecf9d into OpenTreeMap:master Feb 23, 2016
@jwalgran jwalgran deleted the feature/jcw/dont-send-filter-when-finding-plot branch February 23, 2016 16:12
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

Successfully merging this pull request may close these issues.

2 participants