Closed (fixed)
Project:
Geolocation Field
Version:
4.x-dev
Component:
GoogleMapsAPI
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
13 Jan 2025 at 13:30 UTC
Updated:
4 Jul 2026 at 12:15 UTC
Jump to comment: Most recent
Comments
Comment #4
secretsayan commentedComment #5
christianadamski commentedThis change does a lot more though...
Comment #6
christianadamski commentedPlease remove or explain the placeId usage and the sessionToken
Comment #7
secretsayan commentedComment #8
secretsayan commented@christianadamski There are two enhancements in this PR to reduce billing:
1. We are retrieving geometry and formatted_address only instead of all the fields.
2. We are binding our api calls in a single session token as explained in documentation here https://developers.google.com/maps/documentation/places/web-service/deta...
Comment #10
aaronbaumanOpened a new branch to try a 4.x version of this patch, but 4.x Places appears to be broken / unsupported.
Comment #11
christianadamski commented@aaronbauman - Where is the 4.x MR? Did I merge that already? Can't find it. What is broken?
For 3.x merged. @secretsayan Thanks!
Comment #13
aaronbaumanThere is no Places API plugin in 4.x, so I was unable to create a similar patch.
Is Places API support deprecated from 4.x on purpose?
Found the Places API sub-sub-module.
https://git.drupalcode.org/project/geolocation/-/blob/4.x/modules/geoloc...
I can work on a 4.x MR, maybe later today.
Comment #15
aaronbaumanOpened MR 138 against 4.x ready for review
In addition to the session token, locally I'm also using Drupal's cache to store places results for Google's recommended 30 days.
This has given me a massive, massive reduction in API usage.
I will post this patch to a separate thread.
Comment #16
christianadamski commentedHey nice. If possible, please fix the code style issues.
FOUND 2 ERRORS AND 3 WARNINGS AFFECTING 5 LINES
------------------------------------------------------------------------------------------------------------------------
65 | ERROR | [x] Functions must not contain multiple empty lines in a row; found 2 empty lines
| | (Squiz.WhiteSpace.SuperfluousWhitespace.EmptyLines)
67 | WARNING | [ ] Line exceeds 80 characters; contains 117 characters (Drupal.Files.LineLength.TooLong)
69 | WARNING | [ ] Line exceeds 80 characters; contains 121 characters (Drupal.Files.LineLength.TooLong)
72 | ERROR | [x] Space found before comma in argument list
| | (Generic.Functions.FunctionCallArgumentSpacing.SpaceBeforeComma)
91 | WARNING | [ ] Line exceeds 80 characters; contains 92 characters (Drupal.Files.LineLength.TooLong)
You can see them on the MR page as well.
Thank you!
Comment #18
christianadamski commentedThanks!