This Drupal 7 module allows the site administrator to add google map in a taxonomy term page. This create geographical maps from taxonomy term title. This can be easily integrated with any taxonomy term, there is no need to edit the taxonomy term.
http://drupal.org/sandbox/ramsonkr/1798706
git clone http://git.drupal.org/sandbox/ramsonkr/1798706.git taxonomy_term_google_maps
Revirews of other projects
node_overlay http://drupal.org/node/1771086#comment-6602064
Submenu Reorder Module http://drupal.org/node/1687552#comment-6607240
Menu Listchildren http://drupal.org/node/1793146#comment-6613052
More reviews of other projects
Pointcrop http://drupal.org/node/1820260#comment-6636962
iptolocation http://drupal.org/node/1823696#comment-6651548
Paypal field http://drupal.org/node/1821704#comment-6651712
Comments
Comment #1
vensiresIn file term_gmap.module
Line 46-47
Maybe in most installations, it's common that when a path starts with "taxonomy" then the full path is taxonomy/term/[:tid] but it might not actually be the case. I would replace lines 46-47 to the following:
if (arg(0)=='taxonomy' && arg(1) == 'term' && $termid = intval(arg(2)) {Line 76
Even though not required in Drupal7, I think it would be best if you used a default value for variable_get('term_gmap_large').
Line 120
You could use the t() function for the content of the #markup element.
Line 124-126
You use the vocabulary name as loaded from the database and then call the t() function upon that variable. Are you sure there is no other way? You could use the i18nstrings() function if available. It's the equivalent of Drupal 6 tt() function.
That's all from me right now. Great idea for a module though! :)
Comment #2
superspring commentedThe install file and info file look fine, except for coding standards. In the file term_gmap.module:
Drupal Coding Standards:
1. Extra Whitespace on lines: 36
2. Incorrect number of space indents on lines: 46-55, etc
3. Spaces should surround an equals sign on lines: 156, 159, etc
There are many more problems than just these. See coder and coder_reviews projects to get an idea on what the code should look like.
Security Problems:
- Line 59, $title should use check_plain - Similar on lines 75, 77, etc
Multithreading:
- term_gmap_admin_settings_submit does not appear thread-safe. Could use a single call or transactions.
Code Placement:
- Javascript should be placed a js file and using Drupal.settings to pass the $title variable.
Comment #3
webdorado commentedComment #4
ramsonkr commentedHi
Thanks for all the tips.
Have fix the problems with Coder.
#1
Have replaced lines 46-47.
The default value for variable_get('term_gmap_large') already given.
#2
$title is term name.
Comment #5
ramsonkr commentedComment #5.0
ramsonkr commentedreview bonus
Comment #5.1
ramsonkr commentedmodule review
Comment #6
ramsonkr commented@all Please review again.
Comment #7
klausimanual review:
foo'; alert('XSS'); var x ='xI get a nasty javascript popup. Please read http://drupal.org/node/28984 again. That would not happen if you pass down the variables with Drupal.settings ;-)Removing review bonus tag, you can add it again if you have done another 3 reviews of other projects.
Comment #8
ramsonkr commented@klausi
Thanks for detailed review.
I have done all the correction mentioned in the above comment. except point 5.
Comment #9
ramsonkr commentedDo you guys have any suggestions for memory exhasution/WSOD.
taxonomy_get_tree($vid, $parent = 0, $max_depth = NULL, $load_entities = FALSE)
$load_entities: If TRUE, a full entity load will occur on the term objects. Otherwise they are partial objects queried directly from the {taxonomy_term_data} table to save execution time and memory consumption when listing large numbers of terms. Defaults to FALSE.
so I hope memory exhasution/WSOD is solved.
Comment #9.0
ramsonkr commentedRevirews of other projects
Comment #9.1
ramsonkr commentedreview bonus
Comment #9.2
ramsonkr commentedreview
Comment #10
ramsonkr commented@all Please review again.
Comment #11
chipway commented@ramsonkr,
Here some results of my Manual Review:
Unconsistant module folder name: it should be "term_gmap" : instead of "taxonomy_term_google_maps"
Lines' length: In term_gmap.module, there are too long lines like 49, 58, 60, 71, 108, 160. You coud make them more readable by going to next line.
link function: In term_gmap.module / Line 60 :
You better use l() function to build the link instead of ...
Use theme: In term_gmap.module on Lines 58 to 61 :
$block['content'] = xxxx
should go through a theme function in order to allow themer to change the design.
More info on variable_del: You must delete the variables when uninstalling the module. E.g. variable_del("term_gmap_width"). Your function term_gmap_admin_settings() creates 4 variables in variable table.
You need hook_uninstall() as term_gmap_uninstall() in term_gmap.install and delete all these 4 variables.
Menus:
Using local task menus will enhance the usability: See MENU_DEFAULT_LOCAL_TASK
Hope this helps.
Comment #12
klausiChanging status base on comment #11. At least the variable_del() issue should be fixed.
the folder name is determined automatically for sandboxes by the project page title, so that is not an issue. Once this gets promoted the short name should be term_gmap, then the folder name used in git clone will also be term_gmap.
Line length: Drupal coding standards do not forbid code lines longer than 80 characters. Only comments have to be below that limit. So that is fine as well.
Comment #13
ramsonkr commentedThanks for detailed review.
#11
I have fixed
link function: In term_gmap.module / Line 60
variable_del() issue
Comment #14
ramsonkr commented@all Please review again.
Comment #15
chipway commented@klausi,
Thks for these very useful details.
@ramsonk,
I think you should also add variable_del('term_gmap_large');
I still think that using local task menus will enhance the usability: See MENU_DEFAULT_LOCAL_TASK, because today use or links to go from one settings page to another is quite different of the usual Drupal interface.
Comment #16
ramsonkr commented@chipway-drupal
Thanks for review.
The missing 'term_gmap_large' added and menu section updated.
Can you please change its status to RTBC .
Comment #17
chipway commented@ramsonkr,
Tried to install and use it:
in README;
- Now go to block administartion = typo
I followed the README and did every thing but I don't see any map.
Could you add more details, so every one may understand what to do to make it work?
On a related subject, could you enhance your Project page by following "Tips for a great project page"?
Comment #18
klausiLooks RTBC to me. Removing review bonus tag, you can add it again if you have done another 3 reviews of other projects.
Comment #19
ramsonkr commented@chipway-drupal
Thanks for all the tips.
updated README and Project page. For Google map the term title must be related to any geographical location. Now I added a message to display for invalid locations.
@klausi,
Thanks
Comment #20
ramsonkr commented@klausi
who will change the status to Fixed
Comment #21
klausino objections for more than a week, so ...
Thanks for your contribution, ramsonkr!
I updated your account to let you promote this to a full project and also create new projects as either a sandbox or a "full" project.
Here are some recommended readings to help with excellent maintainership:
You can find lots more contributors chatting on IRC in #drupal-contribute. So, come hang out and get involved!
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.
Thanks to the dedicated reviewer(s) as well.
Comment #22
ramsonkr commentedThank you very much klausi.
Comment #23.0
(not verified) commentedreview