Project page: http://drupal.org/sandbox/Thomas_de_Graaff/1313478

The Ubuntu LoCo team info module automatically creates four blocks that each display interesting Ubuntu LoCo team information for a selected LoCo. The information is gathered from Launchpad and the Ubuntu LoCo directory.

The following blocks are created:
1. A block displaying your LoCo's teams names, and descriptions, including a logo and a link to the team's home page.
2. A block displaying all your LoCo's members, team leaders, and links to their Launchpad accounts. They are organized by team, including team logo, and a link to the team home page.
3. A block displaying all forthcoming meetings, including meeting date and times and a link to the agenda. And the same for all meetings of last year with an extra link to the meeting minutes.
4. A block displaying all forthcoming events, date and time information, including a event description, and link to the announce and a link to register, and a link to the event page at loco.ubuntu.com. Plus the same information, omitting the description, for last year events.

Screenshots can be found here:
http://www.thomasdegraaff.nl/drupal/?q=node/184

A live demo can be found here:
http://www.thomasdegraaff.nl/test/?q=node/23

Project home page:
http://www.thomasdegraaff.nl/drupal/?q=node/184

Git clone:
git clone http://git.drupal.org/sandbox/Thomas_de_Graaff/1313478.git ubuntu_loco_team_info

CommentFileSizeAuthor
#13 drupalcs-result.txt1.38 KBklausi
#11 drupalcs-result.txt9.53 KBklausi

Comments

klausi’s picture

Status: Needs review » Needs work
  • 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.
  • info file: make sure to list all your (core) dependcies here. Do you require the block module?
  • ubuntu_loco_team_info_uninstall(): all hook implementations need to have proper doc blocks, see http://drupal.org/node/1354#hookimpl
  • module file: @file doc block missing, see http://drupal.org/node/1354#files
  • _ubuntu_loco_team_info_url_exists(): do not use "//" for function documentation. Use the doxygen standards instead.
  • _ubuntu_loco_team_info_url_exists(): indentation errors, the function body should be indented 2 spaces. Please run coder to check your code style http://drupal.org/project/coder
  • "@param path which path of the site we're displaying help": the parameter description should be on a new line, see http://drupal.org/node/1354#functions
  • '#type' => "$type",: no need to wrap $type in "" here
  • "// function onthisdate_help": what is this? Remove it.
  • All functions should have doc blocks, especially hook implementations.
thomasdegraaff’s picture

Thx. Klausie for these practical instructions. :)

thomasdegraaff’s picture

Status: Needs work » Needs review

Issues posted by Klausi are fixed now.

klausi’s picture

Status: Needs review » Needs work

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

  • Run coder to check your style, some issues were found (please check the Drupal coding standards):
    Severity minor, Drupal Commenting Standards, Internationalization, Drupal Security Checks, Drupal SQL Standards, Drupal Coding Standards
    
    sites/all/modules/pareview_temp/test_candidate/ubuntu_loco_team_info.module:
     +35: [normal] curly braces { should end a line, not start one
     +37: [normal] curly braces { should end a line, not start one
     +43: [minor] There should be no trailing spaces
     +170: [normal] String concatenation should be formatted with a space separating the operators (dot .) and the surrounding terms
     +378: [normal] String concatenation should be formatted with a space separating the operators (dot .) and the surrounding terms
     +398: [normal] String concatenation should be formatted with a space separating the operators (dot .) and the surrounding terms
     +414: [minor] Comment should be read "Implements hook_foo()."
     +464: [minor] Comment should be read "Implements hook_foo()."
     +583: [minor] Comment should be read "Implements hook_foo()."
     +599: [minor] Comment should be read "Implements hook_foo()."
    
    Status Messages:
     Coder found 1 projects, 2 files, 5 normal warnings, 5 minor warnings, 0 warnings were flagged to be ignored
    
  • Lines in README.txt should not exceed 80 characters, see the guidelines for in-project documentation.
  • Comments: there should be a space after "//".
    ubuntu_loco_team_info.module:473:  //define module path
    

This automated report was generated with PAReview.sh, your friendly project application review script. Please report any bugs to klausi.

thomasdegraaff’s picture

Status: Needs work » Needs review

Hi Klausi,
I think I forgot to save changes before sending last time, because I did check with coder. Anyhoes, I hope it is alright now, coder doesn't find any errors here anymore. :)

"Coder found 1 projects, 2 files, 0 warnings were flagged to be ignored"

klausi’s picture

Status: Needs review » Needs work

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

  • Run coder to check your style, some issues were found (please check the Drupal coding standards):
    Severity minor, Drupal Commenting Standards, Internationalization, Drupal Security Checks, Drupal SQL Standards, Drupal Coding Standards
    
    sites/all/modules/pareview_temp/test_candidate/ubuntu_loco_team_info.module:
     +174: [normal] String concatenation should be formatted with a space separating the operators (dot .) and the surrounding terms
     +382: [normal] String concatenation should be formatted with a space separating the operators (dot .) and the surrounding terms
     +402: [normal] String concatenation should be formatted with a space separating the operators (dot .) and the surrounding terms
    
    Status Messages:
     Coder found 1 projects, 2 files, 3 normal warnings, 0 warnings were flagged to be ignored
    
  • Comments: there should be a space after "//".
    ubuntu_loco_team_info.module:211:  //date_default_timezone_set('Europe/Amsterdam');
    ubuntu_loco_team_info.module:307:  //date_default_timezone_set('Europe/Amsterdam');
    
  • ./ubuntu_loco_team_info.module: comment lines should break at 80 characters, see http://drupal.org/node/1354#general
        // check if there is a link between [] in the launchpad team description, if so, use that as a link to the team's homepage
    
  • Assignments should hava a space before and after the operator, see http://drupal.org/node/318#operators
    ./ubuntu_loco_team_info.module:74:  $content='';
    ./ubuntu_loco_team_info.module:127:  $content='';
    ./ubuntu_loco_team_info.module:297:  $content='';
    

This automated report was generated with PAReview.sh, your friendly project application review script. Please report any bugs to klausi.

manual review:

  • _ubuntu_loco_team_info_memberscontent(): be careful when embedding user generated variables or third party retrieved data. Although you have a validation function for ubuntu_loco_team_info_defaultlogolink i would suggest to use a check_url() here for $img_url.
  • same in _ubuntu_loco_team_info_memberscontent()
  • _ubuntu_loco_team_info_memberscontent(): if you pass HTML to l() you must use at least filter_xss() for security reasons.
  • "$localepoch = (date('I', $epoch)+1)*3600+$epoch ;": there should be a space before and after an operator (+,*). There should not be a space before ";"
  • ubuntu_loco_team_info_menu(): wrong access arguments, use your defined permission.
  • ubuntu_loco_team_info_perm(): the first permission is never used.
  • ubuntu_loco_team_info_block(): "'info' => t("$blockname")": do not pass variables to t(), because then the text cannot be detected by translation extractors. Use t() directly on $ubuntu_loco_team_info_blocknames.
  • "switch ($ubuntu_loco_team_info_blocknames[$delta]) {": indentation errors for the last 2 cases.
  • "$form['ubuntu_loco_team_info_loconame'] = array(": the closing ");" should be on the same level, see http://drupal.org/node/318#array
  • ubuntu_loco_team_info_admin(): many array structure indentation errors, always use 2 spaces per level.
thomasdegraaff’s picture

Status: Needs work » Needs review

Klausi, thx. again for your concise review and excellent directions. :)

I'm sorry that there still were issues that coder should show. I somehow have a problem with the coder module. It doesn't show minor issues, so when I used it to check the module, it didn't find the errors you mentioned above, while they were in the code. I did check the minor option to show minor issues, so I don't understand why there is a problem with it. This problem I have in two different installations.

Anyhoes, I've addressed all issues mentioned.

kind regards,
Thomas.

klausi’s picture

Status: Needs review » Needs work

I run coder from Drupal 7 with the minor setting enabled.

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

  • Run coder to check your style, some issues were found (please check the Drupal coding standards):
    Severity minor, Drupal Commenting Standards, Internationalization, Drupal Security Checks, Drupal SQL Standards, Drupal Coding Standards
    
    sites/all/modules/pareview_temp/test_candidate/ubuntu_loco_team_info.module:
     +621: [normal] String concatenation should be formatted with a space separating the operators (dot .) and the surrounding terms
    
    Status Messages:
     Coder found 1 projects, 2 files, 1 normal warnings, 0 warnings were flagged to be ignored
    
  • Comments should be on a separate line before the code line, see http://drupal.org/node/1354#inline
    ./ubuntu_loco_team_info.module:399:  $block_content = '';  //declare your output variable
    ./ubuntu_loco_team_info.module:406:} // function ubuntu_loco_team_info_help
    ./ubuntu_loco_team_info.module:415:} // function ubuntu_loco_team_info_perm()
    ./ubuntu_loco_team_info.module:464:} // function ubuntu_loco_team_info_block
    

This automated report was generated with PAReview.sh, your friendly project application review script. Please report any bugs to klausi.

manual review:

  • ubuntu_loco_team_info_init(): why do you need hook_init() (bad for performance)? Add the CSS when the block is displayed.
  • "$img_url_tagged = filter_xss('<img src="' . $img_url . '">');": better use theme('image', ...) to generate image markup.
  • "// create content": All comments should start capitalized and end with a "."
  • "$events_json = strip_tags(file_get_contents($dataurl));": why do you need strip_tags() here? Sanitization should only be done immediately before output. Or do you receive invalid JSON here that you need to fix? Please document that if it is so.
  • "'#options' => $locosubteamnames,": #options on checkboxes form elements is not XSS protected, so you should wrap those elements in check_plain(). See http://drupal.org/node/28984
  • "if ($selectedloco != '') {": indentation errors in the body of this if statement. Make sure that the code is on the correct indentation level.
  • I would recommend that you define your own theme functions for the markup that you build, because then it can be easily overridden by themes. You would separate retrieving/building the data from arranging it by passing variables to theme functions. But for me this is not a requirement for this approval process.

So I think this is nearly ready.

thomasdegraaff’s picture

  • ubuntu_loco_team_info_init(): why do you need hook_init() (bad for performance)? Add the CSS when the block is displayed.

Done.

  • "$img_url_tagged = filter_xss('Only local images are allowed.');": better use theme('image', ...) to generate image markup.

I couldn't find any documentation for theme('image', ...) so I used theme_image(..) instead. I suppose it has the same functionality?

  • "// create content": All comments should start capitalized and end with a "."

Done.

  • "$events_json = strip_tags(file_get_contents($dataurl));": why do you need strip_tags() here? Sanitization should only be done immediately before output. Or do you receive invalid JSON here that you need to fix? Please document that if it is so.

Corrected this by removing strip_tags, and adding check_plain on some output.

  • "'#options' => $locosubteamnames,": #options on checkboxes form elements is not XSS protected, so you should wrap those elements in check_plain(). See http://drupal.org/node/28984

Done.

  • "if ($selectedloco != '') {": indentation errors in the body of this if statement. Make sure that the code is on the correct indentation level.

Done.

  • I would recommend that you define your own theme functions for the markup that you build, because then it can be easily overridden by themes. You would separate retrieving/building the data from arranging it by passing variables to theme functions. But for me this is not a requirement for this approval process.

Work in progress. :)

thomasdegraaff’s picture

Status: Needs work » Needs review

Fixed issues posted by Klausi in #8 (see #9, comment above this one) and added theme layer.

Used theme_image(...) instead of theme('image'... cause I couldn't find documentation about theme('image'...

klausi’s picture

Status: Needs review » Needs work
StatusFileSize
new9.53 KB

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

  • Drupal Code Sniffer has found some code style issues (please check the Drupal coding standards). See attachment.
  • Comments: there should be a space after "//", see http://drupal.org/node/1354#inline
    ubuntu_loco_team_info.css:51:  //font-weight: normal;
    ubuntu_loco_team_info.css:57:  //text-align:center;
    
  • ./ubuntu_loco_team_info.module: all functions should have doxygen doc blocks, see http://drupal.org/node/1354#functions
    
    function _ubuntu_loco_team_info_scheme() {
    
  • All text files should end in a single newline (\n). See http://drupal.org/node/318#indenting
    ./ubuntu_loco_team_info.info ./schemecontent.tpl.php ./memberscontent.tpl.php ./teamscontent.tpl.php ./README.txt ./ubuntu_loco_team_info.module ./eventscontent.tpl.php ./meetingscontent.tpl.php ./ubuntu_loco_team_info.css
    

This automated report was generated with PAReview.sh, your friendly project application review script. Go and review some other project applications, so we can get back to yours sooner.

manual review:

  • eventscontent.tpl.php: do not do templates like this. Use the HTML as main content of the file and embed the PHP code where needed, not the other way around. Also in the other template files.
thomasdegraaff’s picture

Status: Needs work » Needs review

Thx. again Klausi for your review.

I've corrected template files to use HTML as main content, and embedded php where needed. It looks like a real template file now. :)

Also corrected issues found by coder.

klausi’s picture

Status: Needs review » Needs work
StatusFileSize
new1.38 KB

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. Go and review some other project applications, so we can get back to yours sooner.

manual review:

thomasdegraaff’s picture

Hi Klausi,
thx. again for reviewing.

Manual review:

Manual review:

Done.

Done.

Sanitization is not needed here because these url's are not used by the module to get data, but are data for output only. All sanitization of output content is done in the template_preprocess functions. This specific url is sanitized later for output in the template_preprocess_eventscontentcontent function.

I have taken care of sanitization. See the template_preprocess_meetingscontent function in ubuntu_loco_team_info.module for the sanitization of the data generated in the meetingscontent() function.

thomasdegraaff’s picture

Status: Needs work » Needs review
ceardach’s picture

Status: Needs review » Reviewed & tested by the community

You have absolutely demonstrated your dedication to understand the Drupal community and willingness to embrace our community standards. We certainly should welcome you as a contributor.

Yes yes, the automated code reviewer thingiemajiggy is still flagging some things, but 99.9% of it is so incredibly minor most people wouldn't take the effort to correct it over the benefit they're getting with other readability enhancements. One thing popped up that my OCD would always fix, though... if (! $websitelink) should be if (!$websitelink) ... but I am not going to let that be any more of a further blocker to your application.

Marking this as "utterly and thoroughly" reviewed and tested by the community/klausi.

mlncn’s picture

Congratulations, Thomas! You are now a "vetted" git user and can promote experimental sandboxes to full projects.

Thank you klausi for your fantastic complete reviews, and thank you ceardach for not letting this lie in limbo forever.

patrickd’s picture

Status: Reviewed & tested by the community » Fixed
mlncn’s picture

Thomas, i'd be interested in your feedback on this process also, maybe at Meta Discussion: Project Application Process Revamp. Thanks!

Status: Fixed » Closed (fixed)

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

Anonymous’s picture

Issue summary: View changes

Updated issue summary.