Basic Infos

Drupal 6.x

Link to sandbox: http://drupal.org/sandbox/vlad.k/1396508

git clone --branch master vlad.k@git.drupal.org:sandbox/vlad.k/1396508.git whami_source_adapter
cd whami_source_adapter

Use case

In the context of nodes with geo-information – for example using maps - there is pretty often the requirement to display further geo-related information in the same area as the geo-information of the node itself. ´whami source-adapter´delivers a generic method fulfilling this requirement together with two source adapters, one for Panoramio, one for Wikipedia. This module was part of the development of whami.com and can easily be extented with further source adapters.

Description

‘whami source-adapter’ delivers two configurable display blocks for Wikipedia/Panoramio-content which is locally close to the geo-information of the node.

Panoramio source adapter
The Panoramio source adapter selects photos via the Panoramio REST API using the following parameters:
- Photo type public (not configurable)
- number of displayed photos (configurable)
- for the preview the size ´small´ is used (not configurable)
- for the lightbox-display the size ´medium´ is used (not configurable)
The selected photos are displayed in small size in a block. By clicking on the photo you get a medium size display of the photo in a lightbox. The narrative of the medium size picture shows a link to the photo and author page of the photo.

Wikipedia source adapter
The Wikipedia source adapter selects photos near the zoomed area from the Geonames service on www.geonames.com. This is done via the Geonames module. We recommend to use the premium service of Geonames since it is more reliable.

Configuration

The module has configuration screens within the block configuration for each block:

the definition of the geofield which is used within the node
the radius used for the proximity search around the node´s geofield
the number of small photos in the block (max. 100)

Dependencies

Lightbox 2.0
Geonames
Geo
CCK

References

You can use the website of whami.com as a reference for the working module. If you should require additional source adapters please contact the maintainers of the module.

Reviews of other projects

I (KhaledBlah) am one of the maintainers for this project and I have done reviews of other modules:
03/26/12
http://drupal.org/node/1115102#comment-5780044
http://drupal.org/node/1387212#comment-5785628
http://drupal.org/node/1437126#comment-5785838

I (KhaledBlah) have done 3 more reviews which I would like to see attributed to this project.
05/18/12
http://drupal.org/node/1585740#comment-6012792
http://drupal.org/node/1459458#comment-6008648
http://drupal.org/node/1535858#comment-6012922

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

vlad.k’s picture

Issue summary: View changes

Link to sandbox.

vlad.k’s picture

Status: Active » Needs review
vlad.k’s picture

Issue summary: View changes

Added link to git repository

chertzog’s picture

FileSize
32.84 KB

It appears 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.
Review of the master branch:

  • README.txt is missing, see the guidelines for in-project documentation.
  • Remove "version" from the info file, it will be added by drupal.org packaging automatically.
  • ./whami_source_adapter.module: all functions should be prefixed with your module/theme name to avoid name clashes. See http://drupal.org/node/318#naming
    function whami_get_information_bounding_box($bbox, $lan, $categoriesID, $sourceID, $maxRows, $titleshrink, $bodyshrink, $linkshrink, $maxRequestRows, $sessionID) {
    function whami_get_information_geopoint_radius($lat, $lon, $radius, $lan, $categoriesID, $sourceID, $maxRows, $titleshrink, $bodyshrink, $linkshrink, $maxRequestRows, $sessionID) {
    function convert_bounding_box_geopoint_radius($north, $east, $south, $west) {
    function convert_geopoint_radius_bounding_box($zLon, $zLat, $radius) {
    
  • ./modules/whami_source_adapter_wikipedia/whami_source_adapter_wikipedia.inc: all functions should be prefixed with your module/theme name to avoid name clashes. See http://drupal.org/node/318#naming
    function whami_get_information_bounding_box_wikipedia($bbox, $lan, $max_request_rows) {
    function whami_get_information_geopoint_radius_wikipedia($lat, $lon, $radius, $lan, $max_request_rows) {
    
  • ./modules/whami_source_adapter_panoramio/whami_source_adapter_panoramio.inc: all functions should be prefixed with your module/theme name to avoid name clashes. See http://drupal.org/node/318#naming
    function whami_get_information_panoramio_return($result) {
    function whami_get_information_bounding_box_panoramio($bbox = NULL, $lan = "", $max_request_rows = 20, $img_size = 'thumbnail') {
    function whami_get_information_geopoint_radius_panoramio($lat = 0, $lon = 0, $radius = 5, $lan = "", $max_request_rows = 20, $img_size = 'thumbnail') {
    function whami_panoramio_merge_preview_pics($result, $result_preview, $img_size_preview) {
    
  • Bad line endings were found, always use unix style terminators. See http://drupal.org/coding-standards#indenting
    ./whami_source_adapter.info:                                                     ASCII English text, with CRLF line terminators
    ./modules/whami_source_adapter_panoramio/whami_panoramio_table.tpl.php:          ASCII text, with CRLF line terminators
    modules/whami_source_adapter_panoramio/whami_panoramio_pic.tpl.php
    modules/whami_source_adapter_panoramio/whami_panoramio_table.tpl.php
    whami_source_adapter.info
    
  • Remove all old CVS $Id tags, they are not needed anymore.
    modules/whami_source_adapter_wikipedia/whami_source_adapter_wikipedia.info:1:; $Id:$
    modules/whami_source_adapter_panoramio/whami_source_adapter_panoramio.info:1:; $Id:$
    whami_source_adapter.info:1:; $Id:$
    
  • Run coder to check your style, some issues were found (please check the Drupal coding standards). See attachment.
  • Drupal Code Sniffer has found some code style issues (please check the Drupal coding standards). See attachment.

This automated report was generated with PAReview.sh, your friendly project application review script. You can also use the online version to check your project. Get a review bonus and we will come back to your application sooner.

chertzog’s picture

Status: Needs review » Needs work
vlad.k’s picture

Status: Needs work » Needs review

I moved from the master branch to a versioned branch and fixed all the code style issues. The online code style review at http://ventral.org/pareview doesn't return any errors or warnings.

Please review again.

martin.l’s picture

Hi,

is there any progress on this one?

Best regards,
martin.l

martin.l’s picture

Hi,
we would really like to publish this module and think that all requirements have been fulfilled in the meantime, so there is only very few left on the reviewers side to do ... we would ask in the most polite way if there is a chance to take this last step ;-)

Regards,
martin.

patrickd’s picture

Hi,

I'm sorry for the delay,
as there are currently hundreds applications in the queue we need more reviewers,
so think about getting a review bonus and we will come back to your application sooner.

martin.l’s picture

Hi,

okay, thanks for the answer. We´ll see, what we can do in terms of review bonus.

Still we would be grateful if this application was given some priority, since we are deeply convinced that the module could be very helpful for the community...

Regards,
martin.

martin.l’s picture

Issue summary: View changes

Text formatting.

KhaledBlah’s picture

Issue summary: View changes

added first review of another module for the review bonus

KhaledBlah’s picture

Issue summary: View changes

added my username and a link my profile to review bonus description for clarification

KhaledBlah’s picture

Issue summary: View changes

add another personal review

KhaledBlah’s picture

Issue tags: +PAreview: review bonus

As per http://drupal.org/node/1410826 I have added the review bonus tag. Please see the list of reviews I have done on the first post of this page.

KhaledBlah’s picture

Issue summary: View changes

added 3 review for review bonus

klausi’s picture

Status: Needs review » Needs work
Issue tags: -PAreview: review bonus
FileSize
2.79 KB

Thanks for your reviews, just make sure that you pick applications that did not get a review in a long time.

Review of the 6.x-1.x branch:

This automated report was generated with PAReview.sh, your friendly project application review script. You can also use the online version to check your project. Get a review bonus and we will come back to your application sooner.

manual review:

  • Info files contains a strange first character, see http://drupalcode.org/sandbox/vlad.k/1396508.git/blob/refs/heads/6.x-1.x...
  • whami_source_adapter_convert_bbox_geopoint_radius(): doc comments should break at 80 characters, not earlier. See http://drupal.org/node/1354#general
  • whami_source_adapter_wikipedia_block(): all user facing text should run through t() for translation. Same for whami_source_adapter_panoramio_block().
  • whami_source_adapter_wikipedia.module: do not globally include the inc files (now they are loaded on literally every page request), include them when you actually need them.
  • template_preprocess_whami_source_adapter_wikipedia_content(): do not call theme_image() directly, use theme('image', ...) instead.
  • template_preprocess_whami_source_adapter_wikipedia_content(): $entry['body'] stems from an untrusted third party source, so you need to sanitize that. See http://drupalscout.com/knowledge-base/drupal-text-filtering-cheat-sheet-... Or does geonames already sanitize this?
  • "t('Author: ') . l($variables['owner_name'], $variables['owner_url'], array('external' => TRUE));": do not concatentate translatable strings, use placeholders instead.
  • htmlentities($logo . '<br />' . $title_link . '<br />' . $owner_link . '<br />' . $variables['panoramio_license']);: this will break the br tags, no? And you should use check_plain(), filter_xss() or whatever Drupal function is appropriate.

Removing review bonus tag, you can add it again if you have done another 3 reviews of other projects.

vlad.k’s picture

Status: Needs work » Needs review

We fixed the above mentioned issues and commited the changes to git.

regarding the last issue:
htmlentities($logo . '
' . $title_link . '
' . $owner_link .
'
' . $variables['panoramio_license']);: this will break the br
tags, no? And you should use check_plain(), filter_xss() or whatever
Drupal function is appropriate.

This code is functional the way it is and htmlentities is appropriate.
The result will be used in a Java Script function which requires the
input to be encoded in this way.

We really want to give back and contribute to the Drupal community. But we have no more resources to speed up the review proces with own reviews. It would be nice if you could consider our efforts in the further priorisations of the review issue. Especially the Drupal Panoramio integration is a requested feature, so I think it is a true benefit for the community, when this project is released.

martin.l’s picture

Hi,

since all requirements have been fulfilled by now ... I would like to ask in the most polite way, if there are any obstacles left, keeping this module from being published?

Regards,
Martin.L

patrickd’s picture

Sorry for the delay, indeed the biggest obstacle is the small number of reviewers :/

Please consider doing another 3 manual reviews of other projects so we can come back to you sooner.

martin.l’s picture

To be honest...this is some kindda frustrating. Every time we have eliminated all visible errors, new ones are being discovered, hindering this great module from being availabe to the community. All errors have been resolved: Could you please take a final look ... and release it? Thank you so much ...

martin.l’s picture

Issue summary: View changes

added text "Reviews of other projects" in a h2 tag for better readability

KhaledBlah’s picture

Issue tags: +PAreview: review bonus

added PAReview: review bonus as per http://drupal.org/node/1410826

klausi’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: -PAreview: review bonus
FileSize
6.2 KB

Review of the 6.x-1.x branch:

  • ./modules/whami_source_adapter_wikipedia/whami_source_adapter_wikipedia.tpl.php: the byte order mark at the beginning of UTF-8 files is discouraged, remove it.
  • ./modules/whami_source_adapter_wikipedia/whami_source_adapter_wikipedia.info: the byte order mark at the beginning of UTF-8 files is discouraged, remove it.
  • Drupal Code Sniffer has found some issues with your code (please check the Drupal coding standards). See attachment.

This automated report was generated with PAReview.sh, your friendly project application review script. You can also use the online version to check your project. Get a review bonus and we will come back to your application sooner.

manual review:

  1. whami_source_adapter_demo(): why do you check_plain() the session id, you are not printing it anywhere here? Sanitization is only necessary if you are outputting user provided input, otherwise the data passed around should be kept as is. See also http://drupal.org/node/28984
  2. Same in whami_source_adapter_wikipedia_block(). And whami_source_adapter_panoramio_block().
  3. whami_source_adapter_wikipedia_block(): "module_load_include('inc', 'whami_source_adapter_wikipedia');": no need to use module_load_inlcude as you are including files from your own module which you already know where they are. Use something like require_once dirname(__FILE__) . '/mymodule.inc';
  4. whami_source_adapter_panoramio.module: are you sure that you need to globally include the inc files? You should include them only if you actually need them, so that they are not included on every single page request.
  5. "theme_image(drupal_get_path('module', 'whami_source_adapter_panoramio') . '/panoramio-logo.png');": don't call theme_image() directly, use theme('image', ...) instead. Same for theme_table() calls.
  6. "htmlentities($logo . '<br />' . $title_link . '<br />' . $owner_link . '<br />' . $variables['panoramio_license']);": you have HTML tags in that call, but you escape them afterwards?

Although you should definitively fix those issues they are not application blockers, so I guess this is RTBC. Removing review bonus tag, you can add it again if you have done another 3 reviews of other projects.

patrickd’s picture

Status: Reviewed & tested by the community » Fixed

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.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Anonymous’s picture

Issue summary: View changes

added links to reviews done by me (KhaledBlah)