Hi folks,

After working few years with Drupal, I am in love with this CMS and have decided to actively contribute to the community. I have few modules developed for Drupal 6 and would like to share with the community.

I will just start with one now.

The details for the module are as follows:
Module: Curdbee

This module allows integration with CurdBee invoicing system, http://www.curdbee.com
It basically allows user to view their outstanding invoices by logging to their account. The system provides a very easy to use interface for site admin. Once the module is configured, site admin just have to associate users with CurdBee client account. This can be done while adding a new user or editing an existing user. The module also adds a new tab to user area for easy access to invoices.

Sandbox URL: https://drupal.org/sandbox/ashishupadhayay/2153537
GIT: git clone --branch 6.x-1.x http://git.drupal.org/sandbox/ashishupadhayay/2153537.git curdbee
Drupal core: 6.x

I have reviewed the whole code manually and using pareview.sh.

Manual reviews of other projects:
https://drupal.org/comment/8286113#comment-8286113
https://drupal.org/comment/8286215#comment-8286215
https://drupal.org/comment/8286299#comment-8286299

Additional reviews:
https://drupal.org/comment/8334995#comment-8334995
https://drupal.org/comment/8576149#comment-8576149
https://drupal.org/comment/8576071#comment-8576071
https://drupal.org/comment/8576267#comment-8576267

Please let me know if you would like to know more about this module.

Regards,
Ash

Comments

perignon’s picture

You neglected to put the Drupal version in the title of your post.

auworks’s picture

Title: CurdBee - Module Review » [D6] CurdBee
auworks’s picture

Thanks Perignon,

I just found out about that. Fixed it...

Cheers,
Ash

auworks’s picture

Issue summary: View changes
PA robot’s picture

We are currently quite busy with all the project applications and we prefer projects with a review bonus. Please help reviewing and put yourself on the high priority list, then we will take a look at your project right away :-)

Also, you should get your friends, colleagues or other community members involved to review this application. Let them go through the review checklist and post a comment that sets this issue to "needs work" (they found some problems with the project) or "reviewed & tested by the community" (they found no major flaws).

I'm a robot and this is an automated message from Project Applications Scraper.

nitesh pawar’s picture

Hi ashishupadhayay,

There is still a master branch, make sure to set the correct default branch: http://drupal.org/node/1659588 . Then remove the master branch, see also step 6 and 7 in http://drupal.org/node/1127732

auworks’s picture

Hi Niteshp,

I am sure that I had removed the master branch. Let me just double check...

auworks’s picture

Priority: Normal » Critical
auworks’s picture

Any word on this guys? Still waiting on someone to review my project application...

th_tushar’s picture

Hi ashishupadhayay,
I have manually reviewed the module code, I found that you have not followed the drupal commenting standards, check the API documentation and comment standards (https://drupal.org/node/1354) for the commenting standards for hook implementation methods.
Second, regarding drupal_add_css() in hook_init() function, I checked the css file and there is a CSS code only for displaying the table of invoice data. The css file will be loaded on all page requests, which is not required. So, try to load it on the required page.
Third, you are using the variable_get() in the module, on uninstallation of the module, there may be the module variables left in the database. So, you will have to write the .install file, and ensure that the variables are deleted from database on uninstallation.

Thanks.

th_tushar’s picture

Status: Needs review » Needs work
auworks’s picture

Hi th_tushar,

Thanks for the pointers mate. I will look into those issues ASAP.
Do you mind shedding some lights on comment standards... I referred to the page and I am finding it hard to get my head around it...

Thanks in advance.

Cheers,
Ash

auworks’s picture

Issue summary: View changes
auworks’s picture

Status: Needs work » Needs review

Fixed all the reported issues. Can someone review this module for me please...

klausi’s picture

Issue summary: View changes

Removing automated review comments, make sure to read through the source code of other projects and provide feedback on that.

auworks’s picture

Hi klausi,

Thanks for your review.

Well, I did look into the code and found that the modules had very few lines of code so thought I would let them know.
Now that I know that those modules can be reviewed I will make sure that I go through modules that require review and to manually review those modules.

Thanks!

auworks’s picture

Issue summary: View changes
auworks’s picture

Issue summary: View changes
auworks’s picture

Issue summary: View changes
auworks’s picture

Issue tags: +PAreview: review bonus
lord_of_freaks’s picture

Hi

Good module, congrats.

I found some minor issues on the function curdbee_request. You are using CURL and if you want to do that you should (at least) implement the hook_requirements.

Any it doesn´t look like necessary because you can use drupal_http_request for that, and also http_build_query to buid the query_string.

You can see and example of this below

/**
 * Sends a request to CurdBee.
 */
function curdbee_request($type, $condition = array()) {

  $response = array();

  $curdbee_id = variable_get('curdbee_id', CURDBEE_ID);
  $curdbee_api_token = variable_get('curdbee_api_token', CURDBEE_API_TOKEN);
  $condition['api_token'] = $curdbee_api_token;

  $query_string = $data = http_build_query($condition, '', '&');

  $url = 'https://' . $curdbee_id . '/' . $type . '.json?' . $query_string;

  // Make the request.
  $result = drupal_http_request($url);

  if (isset($result) && in_array($result->code, array('200', '302', '307')) && $result->data != '') {
    $response = $result->data;
  }
  else {
    // Add debug info to watchdog.
    watchdog('curdbee', 'Error retrieving @type', array('@type' => $type), WATCHDOG_ERROR);
  }

  return json_decode($response);
}
lord_of_freaks’s picture

Status: Needs review » Needs work
auworks’s picture

Hi lord_of_freaks,

That indeed is a very good suggestion.
I am happy to make changes as per your suggestion.

Thanks very much for pointing me in right direction,

Cheers,
Ash

auworks’s picture

Status: Needs work » Needs review
auworks’s picture

All sorted guys. I have also added validation to data returned via API.
Please review...

xqus’s picture

define('CURDBEE_ID', 'auworks.curdbee.com');
define('CURDBEE_API_TOKEN', '_5V5pmtfnZs7WVYc3av4');

I'm not sure, but if no API token is configured, should the module work at all? It it wise to have a default token configured?

function curdbee_form_alter(&$form, $form_state, $form_id) {

$form_state should be passed by reference: &$form_state (https://api.drupal.org/api/drupal/modules!system!system.api.php/function...)

auworks’s picture

Hi xqus,

Thanks for your review mate.

Well you will need to sign up for a curdbee account to get those details and the module shouldn't work without them. I had my account details in case someone wants to test it without signing up for curdbee. I will reset it when its ready for production.

I have also fixed the curdbee_form_alter definition...

Thanks!

xqus’s picture

Ah, I see. Sounds reasonable! :)

candotri’s picture

Status: Needs review » Needs work

Please put the git clone command in the description of the module. It makes it much easier for someone to check out the code and if it saves a review even a few keystrokes it's worth it.

You are missing @param and @return documentation for several functions.

Good work - things seem orderly and well thought out. I cannot comment on runtime but the code reads well.

auworks’s picture

No worries. I will do that now...

auworks’s picture

Issue summary: View changes
auworks’s picture

Hi candotri,

Thanks for your review mate.
I have made the changes as per your suggestion...

Cheers,
Ash

auworks’s picture

Status: Needs work » Needs review
klausi’s picture

Priority: Critical » Normal
Status: Needs review » Needs work
Issue tags: -PAreview: review bonus +PAreview: security

manual review:

  1. curdbee_invoices(): this is vulnerable to XSS exploits. The $client variable contains data from a third party source and must therefore be treated as untrusted user provided input. You need to sanitize all user provided text before printing into HTML. Make sure to read https://drupal.org/node/28984 again. Same for the $invoices variable in that function. And please don't remove the security tag, we keep that for statistics and to show examples of security problems. ""Phone: ' . $client->client->phone"": this should run through t() for translation, and you should use a placeholder like "@" or "%" for the variable, then it will get check_plain()ed automatically for you.
  2. "$options[] = '- Select -';": all user facing text must run through t() for translation.

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

auworks’s picture

Thanks for your review klausi...

Happy new year...

auworks’s picture

Status: Needs work » Needs review
auworks’s picture

Issue summary: View changes
auworks’s picture

Hi awesome drupal community,

I have made changes as per klausi's suggestion. Can someone review this project for me...

Cheers,
Ash

candotri’s picture

Hi ashishupadhayay,

You will have a better chance at getting reviewed if you review other projects. Do some reviews, update this issue with links to those reviews, update your issue tags with "PAReview: review bonus", and be patient. The reviewers are very busy and your participation will help to clear the queue.

Please be sure that you are actually reviewing code and giving useful comments. It's hard work but it builds our community.

Thank you for participating!

auworks’s picture

Thanks Chad....

Haven't got a time to review any project recently. Just started a new job and its taking all my time :P

Will try to review few projects this weekend :P

Cheers,
Ash

auworks’s picture

Priority: Normal » Major
klausi’s picture

Assigned: Unassigned » dave reid
Status: Needs review » Reviewed & tested by the community

manual review:

  • curdbee_form_alter(): performance problem: you are making a HTTP request every time a form is being built in Drupal, you should only invoke stuff on form IDs that you are actually targeting.

But otherwise looks RTBC to me.

Assigning to Dave Reid as he might have time to take a final look at this.

auworks’s picture

Hi Klausi,

Thanks for your review.

Thx

auworks’s picture

I have made changes to code as per Klausi's suggestion.
Thanks

auworks’s picture

Any word on this guys?

klausi’s picture

Status: Reviewed & tested by the community » Fixed

no objections for more than a week, so ...

Thanks for your contribution, ashishupadhayay!

I updated your account so you can 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 stay 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.

auworks’s picture

Thanks klausi...

Status: Fixed » Closed (fixed)

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