Whitespace handling issues with local venue search
ConversazioniBug Collectors
Iscriviti a LibraryThing per pubblicare un messaggio.
1gcthomas
Steps to reproduce:
1. Navigate to https://www.librarything.com/local
2. Enter an address in the "Find venues" search box (e.g. "1421 Bancroft Way, Berkeley") and click the search button
3. Note the location and map location shown
4. Click "See little libraries"
5. Note the location and map location shown
Expected behavior:
* Location shows the correct address at steps 3 and 5
* Map is centered at approximate location of address at steps 3 and 5
* Nearby venues are shown ranked by distance to location
Actual behavior:
* Location is shown with + signs instead of spaces at step 3
* Location is shown with "%2B" instead of spaces at step 5
* Map is incorrectly centered at step 5 and nearby venues are not ranked correctly due to incorrect location. This is probably due to Google not being able to parse the garbled location string.
1. Navigate to https://www.librarything.com/local
2. Enter an address in the "Find venues" search box (e.g. "1421 Bancroft Way, Berkeley") and click the search button
3. Note the location and map location shown
4. Click "See little libraries"
5. Note the location and map location shown
Expected behavior:
* Location shows the correct address at steps 3 and 5
* Map is centered at approximate location of address at steps 3 and 5
* Nearby venues are shown ranked by distance to location
Actual behavior:
* Location is shown with + signs instead of spaces at step 3
* Location is shown with "%2B" instead of spaces at step 5
* Map is incorrectly centered at step 5 and nearby venues are not ranked correctly due to incorrect location. This is probably due to Google not being able to parse the garbled location string.
2lilithcat
Sounds similar to this bug with tags: https://www.librarything.com/topic/332048#7501131
3gcthomas
>2 lilithcat: Yes, but unfortunately this is still happening despite the other bug being marked as fixed.
4knerd.knitter
>3 gcthomas: Can you verify that this is still happening, because I just tried your steps, and it seemed to be working.
5kristilabrie
Changing bug status.
6gcthomas
>4 knerd.knitter: I just tested it and the issue is still occurring for me.
Here are some screenshots I took showing the issue: https://imgur.com/a/c5YWVQ8
Just in case there was some caching issue with my specific test query, I tried again with a different address I hadn't tried before — same issue.
Here are some screenshots I took showing the issue: https://imgur.com/a/c5YWVQ8
Just in case there was some caching issue with my specific test query, I tried again with a different address I hadn't tried before — same issue.
7knerd.knitter
>6 gcthomas: Can you try a different address and verify that on the first page the map appears to be showing data and be centered correctly? It looks like the map gets messed up after you click on Show Little Libraries.
8kristilabrie
I'm getting this issue on my Mac/Chrome setup. Exactly as reported by gcthomas.
>1 gcthomas: What OS/browser setup are you using?
>1 gcthomas: What OS/browser setup are you using?
9gcthomas
>7 knerd.knitter: Yes, the first map location is correct (although the location is shown with + signs instead of spaces).
I think the map being messed up is a result of the location search string being messed up. If I directly enter the location in the URL, both pages work fine:
* https://www.librarything.com/local/place/Times%20Square,%20New%20York%20City
* https://www.librarything.com/local/littleplace/Times%20Square,%20New%20York%20Ci...
Conversely, if I enter the location with + signs in the search box (e.g. "Times+Square,+New+York+City"), the first page shows the %2Bs and an incorrect map location.
So, I think the behavior is essentially the same for both /local/place/<location> and /local/littleplace/<location>.
>8 kristilabrie: I'm using Firefox on Mac OS.
I can actually reproduce the bug with bare HTTP requests, indicating it's probably not a browser/javascript issue.
curl -L -v 'https://www.librarything.com/local_search.php?vsm=location&q=Times+Square%2C+New+York+City&venueMapSearchSubmit=Search' >page.html
> GET /local_search.php?vsm=location&q=Times+Square%2C+New+York+City&venueMapSearchSubmit=Search HTTP/1.1
< HTTP/1.1 302 Moved Temporarily
< location: /local/place/Times+Square%2C+New+York+City
> GET /local/place/Times+Square%2C+New+York+City HTTP/1.1
< HTTP/1.1 200 OK
Examining the HTML returned by the server, I see these elements:
<h1>Location: Times+Square,+New+York+City</h1>
<a href="/local/littleplace/Times%252BSquare%2C%252BNew%252BYork%252BCity">» See Little Libraries
Making a request for the second page:
curl -v 'https://www.librarything.com/local/littleplace/Times%252BSquare%2C%252BNew%252BYork%252BCity' >page2.html
> GET /local/littleplace/Times%252BSquare%2C%252BNew%252BYork%252BCity HTTP/1.1
< HTTP/1.1 200 OK
The second page returned by the server has this element:
<h1>Location: Times%2BSquare,%2BNew%2BYork%2BCity</h1>
I think the map being messed up is a result of the location search string being messed up. If I directly enter the location in the URL, both pages work fine:
* https://www.librarything.com/local/place/Times%20Square,%20New%20York%20City
* https://www.librarything.com/local/littleplace/Times%20Square,%20New%20York%20Ci...
Conversely, if I enter the location with + signs in the search box (e.g. "Times+Square,+New+York+City"), the first page shows the %2Bs and an incorrect map location.
So, I think the behavior is essentially the same for both /local/place/<location> and /local/littleplace/<location>.
>8 kristilabrie: I'm using Firefox on Mac OS.
I can actually reproduce the bug with bare HTTP requests, indicating it's probably not a browser/javascript issue.
curl -L -v 'https://www.librarything.com/local_search.php?vsm=location&q=Times+Square%2C+New+York+City&venueMapSearchSubmit=Search' >page.html
> GET /local_search.php?vsm=location&q=Times+Square%2C+New+York+City&venueMapSearchSubmit=Search HTTP/1.1
< HTTP/1.1 302 Moved Temporarily
< location: /local/place/Times+Square%2C+New+York+City
> GET /local/place/Times+Square%2C+New+York+City HTTP/1.1
< HTTP/1.1 200 OK
Examining the HTML returned by the server, I see these elements:
<h1>Location: Times+Square,+New+York+City</h1>
<a href="/local/littleplace/Times%252BSquare%2C%252BNew%252BYork%252BCity">» See Little Libraries
Making a request for the second page:
curl -v 'https://www.librarything.com/local/littleplace/Times%252BSquare%2C%252BNew%252BYork%252BCity' >page2.html
> GET /local/littleplace/Times%252BSquare%2C%252BNew%252BYork%252BCity HTTP/1.1
< HTTP/1.1 200 OK
The second page returned by the server has this element:
<h1>Location: Times%2BSquare,%2BNew%2BYork%2BCity</h1>
10knerd.knitter
>9 gcthomas: Can you check if this is still happening; I believe some changes have been made to Local and this may be fixed.
11knerd.knitter
Closing this as fixed because running through the original steps again resulted in the expected behavior; please re-open if this is still happening.