This is a Drupal 7 module.
http://drupal.org/sandbox/scot.hubbard/1531046
git clone http://git.drupal.org/sandbox/scot.hubbard/1531046.git google_map_field
This module allows users to add a "Google Map Field" field-type to any content type. This will then present the content editor with an interactive Google map so that the editor can find the point at which to drop a marker. This map will then be displayed on the final content page when viewed.
Another feature of this module is a WYSIWYG button to allow the inline insertion of map tokens directly in to content. This is feature is compatible with the WYSIWYG module (the button must be enabled in the usual way that WYSIWYG plugins are enabled for WYSIWYG profiles.
Other Projects Reviewed:
(1)
http://drupal.org/node/1538196#comment-5905968
http://drupal.org/node/1281192#comment-5906286
http://drupal.org/node/1434306#comment-5906384 (done)
(2)
http://drupal.org/node/1536778#comment-5912576
http://drupal.org/node/1281192#comment-5912652
http://drupal.org/node/1395500#comment-5912780 (done)
(3)
http://drupal.org/node/1417258#comment-5914974
http://drupal.org/node/1425060#comment-5915172
http://drupal.org/node/1273586#comment-5915252 (done)
(4)
http://drupal.org/node/1512124#comment-5926078
http://drupal.org/node/1536250#comment-5926162
http://drupal.org/node/1421888#comment-5926280 (done)
(5)
http://drupal.org/node/1432692#comment-5920658
http://drupal.org/node/1422616#comment-5930812
http://drupal.org/node/1268140#comment-5930888
| Comment | File | Size | Author |
|---|---|---|---|
| Screen Shot 2012-04-20 at 14.34.13.png | 152.93 KB | scot.hubbard |
Comments
Comment #1
patrickd commentedwelcome,
You are working in the "master" branch in git. You should really be working in a version specific branch. The most direct documentation on this is Moving from a master branch to a version branch. For additional resources please see the documentation about release naming conventions and creating a branch in git.
As installation and usage instructions are quite important for us to review, please take a moment to make your project page follow tips for a great project page. Also create a README.txt that follows the guidelines for in-project documentation.
Remove the license file as it will be added automatically later and all code hosted on d.o is under gpl anyway. Also the old $id$ tags are deprecated since we got git on drupal.org.
while waiting for an in-depht review of your module you can start out fixing some coding style issues detected by automated tools:
http://ventral.org/pareview/httpgitdrupalorgsandboxscothubbard1531046git
We do really need more hands in the application queue and highly recommend to get a review bonus so we can come back to your application sooner.
regards
Comment #2
scot.hubbard commentedMany thanks for the quick response.
I have fixed all but the "still working on master branch" issues, which I still need to get my head around (working with git is completely new to me!)
Comment #3
pgogy commentedGit can be a real pain
I like this module - all seems ok in coder, and it is simple to run and set up (no problems here).
I would consider looking into use hook_help (http://api.drupal.org/api/drupal/modules%21help%21help.api.php/function/...) and possible hook_permission (http://api.drupal.org/api/drupal/modules%21system%21system.api.php/funct...) to see if you only want to allow certain people to be able to change map data - could see a case for this.
Only UX issue I found was that if you allow the field to have multiple values - you can't set them using the map?
Maybe limit the field to one value?
Very impressed though, well done.
Comment #4
scot.hubbard commentedThanks for the suggestions - I shall implement these.
Could you expand on your comment, "if you allow the field to have multiple values - you can't set them using the map?", I don't quite understand what you mean - it all seems to work fine for me.
Comment #5
pgogy commentedAhhh, I see now. I get 5 maps if I say have 5 values, not one map to which I could add multiple values :)
It might be interesting to support multiple default map positions.
Could I give maps a label?
Comment #6
scot.hubbard commentedI shall add the ability to label individual maps. Thanks for the feedback.
Comment #7
luxpaparazzi commentedJavascript should go into .JS files, and parameters/settings should be passes with the settings function ... see http://api.drupal.org/api/drupal/includes!common.inc/function/drupal_add...
Markup should best be placed into theme functions or template files ...
return t("To insert a google map field, <a href='/google-map-field/token-builder' target='_new'>click here for the token builder</a> (opens in a new window)");Links should be created with the l() function, and html should not be passed to t()!
The response time for a review is now approaching 4 weeks.
Get a review bonus and we will come back to your application sooner.
See: http://drupal.org/node/1410826
You could for example start by evaluating my own project:
http://drupal.org/node/1302786
Comment #8
scot.hubbard commentedThanks for the response luxpaparazzi. The reason the JS is not in a .js file is because I have to declare the javascript variables on-the-fly to cope with multiple map fields.
If you can suggest a better way I'd be happy to take a look.
Comment #9
luxpaparazzi commentedDid you check the settings part @ http://api.drupal.org/api/drupal/includes!common.inc/function/drupal_add... ?
Comment #10
scot.hubbard commentedMy problem is that each map (you can have unlimited maps using google map field) needs its own global variable so I cannot declare them in a static JS file.
It may be my inexperience showing through, but I don't see how Drupal.settings can help.
Comment #11
luxpaparazzi commentedyou could create arrays with drupal.settings, even so I'm not an expert on this subject, I suppose it should be possible...
Comment #12
scot.hubbard commentedMoved as much inline JS as possible into static JS files as per comment #7.
Comment #13
scot.hubbard commentedAll issues above have now been addressed and the git repo is branched to 7.x-1.x from master.
Remaining inline JS is there due to the fact that the user can use this module in insert multiple inline maps using the WYSIWYG feature (map token builder), and when this is done the JS needs a global var for each map, and at this point there is a disconnect between Drupal and the JS (I can't dynamically declare the globals needed in the JS, therefore the JS has to be built on the fly and inlined).
Comment #13.0
scot.hubbard commentedAdded link to review comment for another project.
Comment #13.1
scot.hubbard commentedAdded second project review.
Comment #14
scot.hubbard commentedAdded PAReview: review bonus tag.
Comment #15
luxpaparazzi commented@scot, your reviews are quite short, but I won't judge on them ;)
1. Callback functions should not be "hidden" functions, so remove "_" at the geginning:
2. It's bad practice setting height and width fix in code:
'#markup' => '<div id="google_map_field_selector" style="width: 300px; height: 250px;"></div>'they should be defined in CSS files!
I would even suggest putting as much html-code into theme functions or template files.
--
The response time for a review is now approaching 4 weeks.
Get a review bonus and we will come back to your application sooner.
See: http://drupal.org/node/1410826
You could consider evaluating my own application:
http://drupal.org/node/1302786
Comment #16
scot.hubbard commentedThanks luxpaparazzi.
As per point 1 I have removed the leading underscore character from the callback function names.
With regard to point 2, I have moved the style from inline to the CSS file on the line you have highlighted, however, I feel that as much as possible has been done to remove further CSS/HTML from this module. The nature of the module means that a lot of markup, include JS and CSS, has to be built on-the-fly and I feel that moving any more HTML in to theme function would just complicate and slow the module down unnecessarily.
Comment #17
sepph commentedI agree with luxaparazzi... it would be good to try and get as much of your markup as possible in to theme functions or tpl's.
I'd also suggest that you add some simple validation to the form values used by the field as it will let you add some values that'll break the output of the field.
Also it looks as though the field does not respect the 'required field' option when adding the field to an entity.
Other than that though I like the look of this module. It looks nice and lightweight.
Comment #18
scot.hubbard commentedThanks sepph.
The width and height fields have been removed from the google_map_field in favour of these being set by the themer via CSS (the module will drop in default values, which can obviously be overridden). The required field issue is therefore no longer extant.
Also, all HTML in '#markup' fields has been moved the theme functions.
Comment #19
scot.hubbard commentedAdded hook_help() to provide simple config message for end users.
Comment #19.0
scot.hubbard commentedAdded third project review.
Comment #19.1
scot.hubbard commentedAdded project review link.
Comment #19.2
scot.hubbard commentedAdded project review link.
Comment #20
scot.hubbard commentedAdded PAReview bonus tag.
Comment #21
patrickd commentedThanks for your participation, but I'm afraid the comments you did are not very detailed and IMHO not really "reviews".
A good deep review can take up to an hour, this is not about just pointing out 2 things and set the issues to needs work.
Sorry, removing tag.
Comment #21.0
patrickd commentedAdded project review link.
Comment #21.1
scot.hubbard commentedAdded project review link.
Comment #21.2
scot.hubbard commentedAdded project review link.
Comment #22
scot.hubbard commentedAdded review bonus tag.
Comment #23
scot.hubbard commentedI have changed this to need works as I have found a validation bug.
I am leaving the review bonus tag in place, but please do not review until the status is back to needs review.
Thanks!
Comment #24
scot.hubbard commentedField validation issues are now fixed. Status changed back to needs review.
Comment #25
klausiThanks for your reviews. When finishing your review comment also set the issue status either to "needs work" (you found some problems with the project) or "reviewed & tested by the community" (you found no flaws).
manual review:
<script>alert('XSS');</script>as map name I get a nasty javascript popup. Please read http://drupal.org/writing-secure-code and all subpages, especially http://drupal.org/node/28984Removing review bonus tag, you can add it again if you have done another 3 reviews of other projects.
Comment #26
scot.hubbard commentedHi Klausi,
Many thanks for the deep review - your comments and provided links have help me out enormously.
All issues should now be fixed and the project is ready for review again.
With regard to point 3, I thought it didn't really matter if users could access this page as it didn't really do anything. However, on reflection, it is only needed by people who can edit content so I have applied the 'access administration pages' permission to the path.
Some of the points your discovered are silly things that should never have been there, but sometimes you get so close to something you can't see the big picture!
Thanks again, and I shall continue with my reviews of other projects...
Comment #26.0
scot.hubbard commentedAdded project review link.
Comment #26.1
scot.hubbard commentedAdded project review link.
Comment #26.2
scot.hubbard commentedMarked preview PAReview project links as done.
Comment #26.3
scot.hubbard commentedAdded project review link.
Comment #27
scot.hubbard commentedAdded review bonus tag.
Comment #28
klausiPlease don't remove the security tag, we keep that for statistics and to show examples of security problems.
Comment #29
scot.hubbard commentedMy apologies - it was not done intentionally.
Comment #30
klausimanual review:
But otherwise this looks RTBC to me. Removing review bonus tag, you can add it again if you have done another 3 reviews of other projects.
Comment #32
scot.hubbard commentedHi klausi,
Many thanks for your review, I have fixed all the issues highlighted.
Will work on further reviews now.
Thanks again.
Comment #32.0
scot.hubbard commentedAdded project review link.
Comment #32.1
scot.hubbard commentedAdded project review link.
Comment #32.2
scot.hubbard commentedAdded project review link.
Comment #33
scot.hubbard commentedAdded review bonus tag.
Comment #34
patrickd commentedYour project page could still be enhanced by making it a little more structured you may have a look at the tips for a great project page.
You should make the label translatable:
'label' => 'Google Map Field',FYI, this has probably no effect.
to make your function naming consistent may should rename google_map_field_default to google_map_field_formatter
Maybe not a bad idea to make "http://maps.googleapis.com/maps/api/js?sensor=false" configurable ?
After all I don't think here's anything serious.
Thanks for your contribution and welcome to the community of project contributors on drupal.org!
I've granted you the git vetted user role which will let you promote this to a full project and also create new projects as either sandbox or "full" projects depending on which you feel is best.
Thanks, also, for your patience with the review process. Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.
As you continue to work on your module, keep in mind: Commit messages - providing history and credit and Release naming conventions.
Thanks to the dedicated reviewer(s) as well.
Comment #35
scot.hubbard commentedMany thanks to patrickd, Klausi and all the reviewers.
Comment #36.0
(not verified) commentedAdded project review link.