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

Viewing UK reports page with 0 reports directly (via than ajax) can give error #2160

Closed
dracos opened this issue Jun 15, 2018 · 2 comments
Closed
Assignees
Labels
Projects

Comments

@dracos
Copy link
Member

dracos commented Jun 15, 2018

e.g. Bristol closed reports. Due to default map co-ord (0,0) then trying to be converted to easting/northing somewhere.

@dracos dracos added the Bug label Jun 15, 2018
@dracos dracos added this to Icebox in FixMyStreet Apr 29, 2019
@ludovic-tc ludovic-tc self-assigned this Jul 2, 2021
@ludovic-tc
Copy link
Contributor

ludovic-tc commented Jul 2, 2021

Please could I have some repro steps for this bug @dracos?

@dracos
Copy link
Member Author

dracos commented Jul 5, 2021

tl;dr Looks like this was also reported at #2617 and already fixed there.

This bug was three years old, so I didn't know/remember anything about it :) For interest, here's the steps I took to discover the above fact, might be some useful tips in here:

  1. I said Bristol closed reports, so I visited the Bristol cobrand, all reports, picked closed and ended up with the URL https://fixmystreet.bristol.gov.uk/reports/Bristol?sort=updated-desc&status=closed (I removed any lat/lon/zoom as otherwise those are taken as defaults) - it displayed okay. But it had reports, whereas this ticket said a page with 0 reports so I assumed back then it didn't have any.
  2. I tried to find a URL that would have zero reports on load (as per the ticket, not via ajax), and luckily restricting to the first category in the filter list on the All Reports page worked: https://fixmystreet.bristol.gov.uk/reports/Bristol?sort=updated-desc&status=closed&filter_category=Abandoned%20vehicles - but again, the page still loaded fine.
  3. I checked the source of that page and saw it did have e.g. data-latitude=0 so it had got the map co-ordinate mentioned. But it was not showing an error.
  4. The ticket said the error was caused by lat/lon -> e/n conversion, so I found the function that does that conversion, convert_latlon_to_en, and looked for where that was used. Most uses were on a per-report basis, or during reporting, not relevant, but there were uses under FixMyStreet::Map::.
  5. Two of them were CheshireEast and Northamptonshire, so not relevant to Bristol, but the other was FixMyStreet::Map::UKCouncilWMTS, and I saw that FixMyStreet::Map::Bristol was a subclass of that.
  6. Looking for the use of the function in UKCouncilWMTS.pm, I saw the line above had special (0,0) handling!
  7. I ran git blame to see when the fix was added, and tracked down the relevant GitHub ticket from that :)

@dracos dracos closed this as completed Jul 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
Development

No branches or pull requests

2 participants