This module creates a new widget type for the Address Field. It allows populating an Address Field from a Geofield lat/lon pair, using Google Maps API Reverse Geocoding capability.
A simple use case is the following:
- field_input is a Text field, use to type in an address, using "Geocoder field with autocomplete" widget.
- field_coord is a GeoField, which will store the geodata in a Lat/Lon pair format.
- field_address is an AddressField, using this module's "Populate from Geofield" widget.
From any input (ex: Empire State Building), Geofield module will retrieve Lat/Lon coordinate, then this module will retrieve a full administrative address using Google Api (city, country, street name, etc.).
Project page
https://drupal.org/sandbox/rcuny/2160073
Repository
git clone --branch 7.x http://git.drupal.org/sandbox/rcuny/2160073.git addressfield_from_geofield
Comments
Comment #1
pachabhaiya commentedDear renaudcuny,
Please use this online tool (pareview.sh) to check for general errors in your module code.
Checking your code using this tool shows lots of errors.
http://pareview.sh/pareview/httpgitdrupalorgsandboxrcuny2160073git
Please take your time to correct those issues.
Cheers!!!
Comment #2
renaudcuny commentedDear Chhabi,
Thanks for your time and comment.
I've fixed all the errors and most of the warnings, only a few warnings remain, about long lines.
http://pareview.sh/pareview/httpgitdrupalorgsandboxrcuny2160073git
Sorry for that, it's my first contrib module submission. Hope I got it right this time! :)
Cheers,
Renaud
Comment #3
adam_thomason commentedHi,
After reviewing some of your code, I have a couple of suggestions to improve your code.
Beginning at line 121:
The if() statement should be replaced with this:
There are several more instances of this. It is better practice to check for empty strings with empty(), rather than comparing empty strings.
Other than these small items, there are no noticeable errors with your code. Keep up the good work.
Cheers,
Adam
Comment #4
renaudcuny commentedHi Adam,
Thanks for the review!
Indeed, it's always hard to get rid of old bad coding habits :). I've updated the code using the empty() function.
I wish you a nice weekend,
Cheers,
Renaud
Comment #5
renaudcuny commentedComment #6
PA robot commentedWe are currently quite busy with all the project applications and we prefer projects with a review bonus. Please help reviewing and put yourself on the high priority list, then we will take a look at your project right away :-)
Also, you should get your friends, colleagues or other community members involved to review this application. Let them go through the review checklist and post a comment that sets this issue to "needs work" (they found some problems with the project) or "reviewed & tested by the community" (they found no major flaws).
I'm a robot and this is an automated message from Project Applications Scraper.
Comment #7
nitesh sethia commentedHey,
Make a new branch called as 7.x and push the code there. Also don't forget to remove the master branch.
Comment #8
hayashi commentedHi @renaudcuny,
I reviewed you code, I found a using file_get_contents().
It's better to using drupal_http_request() instead of file_get_contents() to work with servers behind proxy.
Comment #9
renaudcuny commentedComment #10
renaudcuny commentedHi,
Thanks you 2 for your reviews and comment.
I've made the branch name change, and I'll tale care of @hayashi's comment asap.
I keep you posted :)
Comment #11
renaudcuny commentedComment #12
renaudcuny commentedHi,
I replaced file_get_contents() by drupal_http_request(), and changed the surrounding logic accordingly (commit 5c36330), based on comment from @hayashi.
Thanks again for your review.
Comment #13
gobinathmrenaudcuny there are few coding standards issue reported by pareview, can you address them http://pareview.sh/pareview/httpgitdrupalorgsandboxrcuny2160073git
Comment #14
renaudcuny commentedHi Gobinathm,
Thanks for you review.
These are just warnings on line length, mostly inside comments or due to Google API calls (long addresses like "https://maps.googleapis.com/maps/api/geocode/json?latlng=....."). Is it really a blocking issue?
Cheers,
Renaud
Comment #15
renaudcuny commentedComment #16
gobinathm@renaudcuny those where simple suggestion, not an application blocker
Comment #17
heddnPlease remove .gitignore.
Use https://api.drupal.org/api/drupal/modules%21system%21system.api.php/func... rather than adjusting module weight.
Hard coded language of FR seems an issue. Maybe declare global $language and pull language from there.
Either make this a configurable option (somehow) or remove it. Its not a best practice to hack core or contrib modules.
Use single spaces around the equals. https://drupal.org/coding-standards#operators
Comments like this should either be addressed or noted as a @todo.
Maybe check for HTTP 200 status code too?
Comment #18
heddnAlso all comments, including inline comments should be under 80 characters. See bullet #8: https://drupal.org/coding-standards/docs#drupal
Comment #19
renaudcuny commentedHi heddn,
Thanks a lot for this very long review.
I'll take care of these issues as soon as I've a minute.
Cheers,
Renaud
Comment #20
PA robot commentedClosing due to lack of activity. If you are still working on this application, you should fix all known problems and then set the status to "Needs review". (See also the project application workflow).
I'm a robot and this is an automated message from Project Applications Scraper.