The Drupal 7 Trello module provides an API for developers to integrate their site with Trello data. See http://trello.com for information about the Trello project management system. A developer can use this module to read/write Trello cards, lists, boards and anything available in the Trello API reference here: https://trello.com/docs/api/. I haven't tested the module with all of the API as there is quite a bit there, but I can successfully read anything as a json object and create new cards with descriptions.
Project page: http://drupal.org/sandbox/daven/1795720
Repo viewer: http://drupalcode.org/sandbox/daven/1795720.git
Get the code: git clone --recursive --branch 7.x-1.x http://git.drupal.org/sandbox/daven/1795720.git trello
This module currently targeted to other developers interested in working with Trello. I plan to expand the module to do more useful things with API but currently the example module and API explorer page are working successfully. Please see the project page for install instructions.
| Comment | File | Size | Author |
|---|
Comments
Comment #1
varunmishra2006 commentedThere are lots of coding standard error found. Please check my review here http://ventral.org/pareview/httpgitdrupalorgsandboxdaven1795720git-7x-1x
Also set the correct default branch and remove the master branch.
Comment #2
daven commentedI've updated comments and such to match Drupal coding standards.
Comment #3
jvdurme commentedHi there,
I see that you set a few variables, but you should also delete them when the user uninstalls your module.
Create a trello.install file with hook_uninstall() and delete your variables with variable_del().
I didn't go much deeper into your code, since I'm no expert. But deleting these variables is something that can block module approval. Trust me. ;)
And there are still some minor coding standard errors:
You can manually check your code for coding standard errors at http://ventral.org/pareview or use the Coder module.
cheers!
Comment #4
daven commentedSince October I've had a lot of work and a new baby in the house. =) Happy to be getting back to this again though.
I now have a clean automatic code review: http://ventral.org/pareview/httpgitdrupalorgsandboxdaven1795720git
Re-submitting for review.
-Dave
Comment #5
maxgor commentedHere is in the code you define forced the handler for submut buttons on all forms, for example:
$form['#submit'][] = 'trello_api_explorer_form_submit';
however the same handler is executed by default for forms if you define function with name name_form_submit()
Best regards,
Max.
Comment #6
daven commentedmaxgor thanks for the tip. I removed the redundant lines and did some other clean-up.
-dave
Comment #7
Bob Humphrey commentedSome small stuff:
Also, when I bring up the Trello Example Configuration page, I get the following error messages:

I went to trello.com, opened an account, created a board, and added some lists and a bunch of cards. However, I wasn't really able to find my information using the Trello API Explorer page you created. I was probably doing something wrong in entering the parameters, but I spent all the time I could studying the Trello documentation. It might have been easier if your example application worked.
Bob Humphrey
Comment #8
daven commentedThanks Bob, I will address those items before setting the status back to needs review. I agree the API explorer could use some improvement to be more helpful. I think I can fix the example module bug easily enough.
I also have plans for views integration which would make this much more interesting than just the base API + example. Not sure if I should get that in before the review. I'll see when I have some more free time in at least a week from now.
Dave
Comment #9
daven commentedI did some major improvements to the API explorer and some other bug fixes as suggested in this discussion. And since the module requires some messing with trello API keys and authentication tokens I set up a demo site here: http://trello.gv.ca/trello/api-explorer Now you can quickly see what the module does so far.
Improvements to API explorer:
Comment #10
sylus commentedJust did a automated review using Code Sniffer and found some minor issues:
Did a manual review as well and code looks good just some minor spelling mistakes:
http://drupalcode.org/sandbox/daven/1795720.git/blob/refs/heads/7.x-1.x:...
http://drupalcode.org/sandbox/daven/1795720.git/blob/refs/heads/7.x-1.x:...
I did have a question about having two .info files in the same directory though perhaps move trello_api_explorer (module + info) into a subfolder? I could totally be wrong about this though.
Same Directory:
a) trello.info
b) trello_api_explorer.info
As an aside I thought it was pretty cool that you are supporting both functional and OO version of the trello api. Also bonus points for providing an example module on how to leverage the functionality. Will definitely be taking a further look at this!
Comment #11
daven commentedsylus, thanks for your review. Spelling typos and such corrected. Thanks for your aside, though I think it was exactly on topic. :)
Looks like views_ui module uses a second .info file in the module directory:
http://drupalcode.org/project/views.git/tree/refs/heads/7.x-3.x
But not in the D8 version so I'm not sure what is best practice and I didn't find mention of this in the coding standards.
http://drupalcode.org/project/views.git/tree/refs/heads/8.x-3.x
I don't have a preference here, it just ended up where it is as I was developing. Also, the example module is in a 'modules' subdirectory but maybe should just be in trello_example. Anyone have opinions or observed patterns on where to place submodules?
Comment #12
klausiWe are currently quite busy with all the project applications and I can only review projects with a review bonus. Please help me reviewing and I'll take a look at your project right away :-)
Comment #13
codeyourdream commented1. Set error_reporting in your php configuration to E_ALL | E_STRICT and test module again
Problems apper on at least the following page:
- admin/config/trello/example
2. You do not need own submission handler for trello_config_form() because you use core system_settings_form($form) function that saves variables for you. Also you should not clear $form argument in trello_config_form():
-14: $form = array();3. You do not need global variables
Instead, use the common practise with a staticly cached variables:
4. Use constants instead of hard-coded strings such as $base_url = 'https://trello.com/docs/api/';
5. Use t() function properly
trello_api_explorer.module
A couple of questions:
1. Why not use drupal_http_request() function?
2. You really need $include_curl_handle param in trello_api() function?
Comment #14
sreynen commented#13 has blocker issues, so I'm setting this back to needs work.
Comment #15
drupik commentedThis is not a correct use of t() function, it will returns the error: "The submitted string contains disallowed HTML" if you try to translate. It should be something like this:
$fieldset['#description'] = t('API reference: !url', array('!url' => l(t($url), $url)));Comment #16
daven commentedThanks all for the continued feedback. I'm hoping to get to the changes soon.
codeyourdream the reason I'm not using the drupal_http_request() function is because I wasn't aware of it. Thanks for pointing that out, I'll give it a try.
drupik, thanks for clarifying. I was going to ask about proper t() usage but you already answered.
Comment #17
codeyourdream commentedhttp://api.drupal.org/api/drupal/includes%21common.inc/function/l/7
Comment #18
drupik commentedSo it seems that
<a>tag is allowed. But in this way also have translation available.Comment #19
sreynen commentedThe encouragement in http://api.drupal.org/api/drupal/includes%21common.inc/function/l/7 to include link tags in translation strings surprises a lot of people. But that is, indeed, what the documentation says you should do, so the advice in #13 should be followed. The formats in #15 and #18 are a common practice, but #13 follows best practice.
Comment #20
daven commentedI went with the t function as suggested in #13. Also removed the curl requirement as drupal_http_request is working for me, and other changes from this discussion.
Thanks again for the suggestions.
Comment #21
sreynen commentedt('at trello.com').I was hoping to mark this as reviewed and tested. Unfortunately that last one is a blocker, as it can cause fatal errors on older PHP versions. If you can fix that, I'll try to finish this up quickly.
Comment #22
daven commented@sreynen
Thanks again. I've been meaning to do a reviews of another projects too but haven't had a chance yet. I'll try to get on that soon.
Comment #23
fgmSome things that should probably be changed in the module:
'!url' => check_url(...)Comment #24
daven commentedThanks fgm,
I made the changes you suggested. I agree dpm shouldn't be in released code, however it is only in the trello_api_explorer module which is intended for developers and that module has devel as a dependency in its info file. The dpm function provides a very convenient way to pick though the data that the Trello api returns.
I just pulled the latest 7.x-2.x of the coder module and I run drush dcs on my module but I don't see any coding standard violations. Please specify.
Dave
Comment #25
fgmYou're right about the devel dependency: I had only checked it on trello.info, not trello_api_explorer.info.
However, here are the coder_review results I get on on trello_api_explorer:
Line 156: Potential problem: FAPI elements '#title' and '#description' only accept filtered text, be sure to use check_plain(), filter_xss() or similar to ensure your $variable is fully sanitized. '#description' => t('API reference: ') . l($url, $url), Line 156: The $string argument to t() should not begin or end with a space. (Drupal Docs) '#description' => t('API reference: ') . l($url, $url), Line 211: in most cases, replace the string function with the drupal_ equivalent string functions sprintf('$t->%s(\'%s\'%s);', strtolower($method), $path, $query ? ", '$query'" : ''),Comment #26
daven commentedHow did you get those coder_review results? I must be doing something wrong. When I do
drush dcs .ordrush dcs trello_api_explorer.moduleI get a clean report but it now looks like it's missing results.Comment #27
daven commentedp.s. I also get a clean report from http://ventral.org/pareview/httpgitdrupalorgsandboxdaven1795720git-7x-1x but your results look important. Well, the sanitize ones look important although the string is explicitly defined a few lines before so it's not a huge issue but could be rearranged a bit. I'd like to be able to see these results though with my code sniffing tools. but maybe that's a discussion/issue for somewhere else.
Comment #28
sreynen commentedThough it's worth fixing, nothing in #25 seems like a blocker to me. It looks like all previous feedback is addressed now, so I'm marking this reviewed and tested.
Comment #29
daven commentedWoohoo! Thanks.
I just committed the code style fixes from #25 anyway:
http://drupalcode.org/sandbox/daven/1795720.git/commitdiff/6cb807dcd62f6...
Comment #30
fgmThese appear when you enable the "minor" review level and the off-by-default checks in coder_review (not in coder_sniffer).
Comment #31
klausiSorry for the delay, but you have not listed any reviews of other project applications in your issue summary as strongly recommended in the application documentation.
Review of the 7.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. You have to get a review bonus to get a review from me.
manual review:
But that are not blockers, so ...
Thanks for your contribution, daven!
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 #32
daven commentedklausi thanks so much for approving my application before I got to doing some reviews. I still intend to do so. I'm quite happy with the review process and I plan to help out if I can.
Thanks for your review as well... Never done making improvements.
Note, the dpm() is a perhaps hackish way of displaying the returned results in the API explorer and is a submodule for developers so I though it appropriate at least for now. The trello_api_explorer module states devel as a dependency. I might change that eventually, although i'd like to get views integration first.