This module uses the Basecamp API (http://developer.37signals.com/basecamp/) so that tasks and related info can be displayed in Drupal. Currently, the module defines a block for creating tasks in Basecamp and shows a list of tasks for the current user. Basecamp & Drupal users are automatically paired using their email address or can be manually paired. I use the module at work to link our Basecamp account with our staff website and I plan to carry on adding API features.
I've run it through PAReview myself - http://ventral.org/pareview/httpgitdrupalorgsandboxchrisleversuch1433882git
The module is for D7.
Project - http://drupal.org/sandbox/chris.leversuch/1433882
Git - git clone --branch 7.x-1.x http://git.drupal.org/sandbox/chris.leversuch/1433882.git basecamp
| Comment | File | Size | Author |
|---|---|---|---|
| #16 | basecamp-coder-results.png | 71.08 KB | carwin |
| #16 | basecamp-ventral-pareview-results.png | 97.8 KB | carwin |
Comments
Comment #1
jpontani commentedManual Review
basecamp.admin.inc
- basecamp_admin_form: Make sure to enclose #description items in t()
- basecamp_account_report: consider using a theme for this, or at least wrap your output text with t()
- basecamp_people_report: wrap your output with t()
basecamp.blocks.inc
- basecamp_block_basecamp_tasks: wrap your links with t(), "edit" won't be translated currently
- basecamp_block_basecamp_create_task: $options[$record->config_id] = t($record->config_name); don't pass variables to t(), as it requires translators to go back through and find out actual text being translated; if it has to be a variable, translate it when you generate the value
Comment #2
chris.leversuch commentedThanks for the review.
I've been through and added in more t() calls.
The only 1 I'm not sure about is your last comment - the contents of $record->config_name is being pulled from the database as part of the db_select a few lines above. I'm not sure where else I could translate it. Should it be
t('%config_name', array('%config_name' => $record->config_name));?Comment #3
komlenic commentedI don't believe you should be using t() if $record->config_name is user-supplied text, as it appears to be. User-supplied text cannot be translated as you never know what it will be. You should use check_plain() or one of the other sanitizing functions listed here http://api.drupal.org/api/drupal/includes!common.inc/group/sanitization/7 since the entire contents of t() in your existing code is user-supplied.
Consider:
$options[$record->config_id] = check_plain($record->config_name);Comment #4
chris.leversuch commentedThanks, I knew I must be doing something wrong.
I've changed that to check_plain and also used check_plain when the value is saved to the database.
I guess both might not be necessary seemed safer.
Comment #5
patrickd commentedalso if your
settingsmenu item comes after the protectedbasecampitem you should add a proper access argument to any menu item!as there are currently many applications in queue we need more reviewers,
so think about getting a review bonus and we will come back to your application sooner.
Comment #6
chris.leversuch commentedI've improved the project page and also added an access argument to the settings menu item.
Comment #7
geertvd commentedHi great idea,
I'm able to see my assigned issues which is great, however when I try to add one I receive this error:
'Unprocessable Entity(400)'
I only receive this error when I don't assign anyone automatically.
Anyhow I should not receive a Task submitted. message when no task has been created.
some code formatting issues:
http://ventral.org/pareview/httpgitdrupalorgsandboxchrisleversuch1433882git
Comment #8
chris.leversuch commentedgeertvd: Leaving a task unassigned should work now. I need to do some more work on checking return status though.
Also fixed PAReview errors.
Comment #9
novalnet commentedHello
Manual Review :
1. Please use placeholders for dynamic messages.you can use placeholders in drupal_set_message(t($reply->error) . '(' . $reply->code . ')', 'error');
2. Use t() for all texts used in basecamp.module .
ex : Function basecamp_menu() contains 'title' => 'Basecamp' can be 'title' =>t('Basecamp')
Thanks
Comment #10
jpontani commentedDon't wrap your hook_menu titles in t(), as the default title callback for all menu entries is already the t() function. By doing so, you're calling t() twice on the same text (in essence you're doing t(t('Title')), very inefficient), which is unnecessary. See hook_menu's title callback attribute for further details.
Comment #11
chris.leversuch commentedI've fixed the first comment from #9 and left hook_menu text as it is.
Comment #12
Mithrandir commentedI think it looks very nice now.
I wonder why you named your block functions basecamp_block_basecamp_xxx() - I guess it is to ensure no clashes with hook_block_xxx but it does make the function names quite long.
Not a biggie, though.
Comment #13
chris.leversuch commentedYeah just to avoid conflicts. I guess I could have done something like _basecamp_block_xxx() to shorten them.
Comment #14
groupdocs commentedMaybe I doing something wrong but I can't find "My Info (top right)" for API Token.
In top right corner I have only "New features | Account | Upgrades | Sign out". Is there was site update?
Comment #15
chris.leversuch commentedgroupdocs - I'd guess you're using the new Basecamp. This module only works with Basecamp Classic at the moment.
Comment #16
carwin commentedUsing http://groups.drupal.org/node/184389 and http://drupal.org/node/894256 as a template for this review.
152 | ERROR | Function comment short description must end with a full stopAn automated review of your project via Coder has found 1 issue(s) with your code.
Line 168: The $message argument to drupal_set_message() should be enclosed within t() so that it is translatable.Attaching screenshots of the PAReview.sh and Coder outputs.
This seems really close to being done. Code looks clean, module works as expected and I don't see any glaring security holes that need to be fixed before pushing this through. Fix the piddly little errors and drop the master branch, then I'll mark it RTBC.
Awesome job, I will be using this module.
Edit: By the way, I used my company's Basecamp API stuff and this worked flawlessly with the Basecamp Classic projects.
Comment #17
chris.leversuch commentedcarwin,
Thanks for the review.
The master branch has been deleted and the coding errors have now been fixed.
Thanks.
Comment #18
chris.leversuch commentedForgot to set needs review
Comment #19
tdurren commentedDownloaded and installed and worked as expected.
Did not find any major issues in the manual review.
Comment #20
chris.leversuch commentedThanks for all the comments. Anyone want to RTBC?
Comment #21
carwin commented@chris.leversuch I'm not sure I have that authority. I'll try to get in touch with klausi for you though. Good stuff man -- it's at least RTBC in my head.
Comment #22
yannickooSure you can set it to RTBC.
Comment #23
chx commentedThis must have fallen through the cracks somehow, sorry. Chris, accept my apologies.
Thanks for contributing to Drupal!
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.