Commerce Moodle Integration is a module that integrates Drupal Commerce with Moodle.

This module automatically enrolls Drupal users to Moodle courses when buying the specified products. It uses the product's SKU and Moodle course's internal numbers to relate them.

For now, only Moodle 2.3 is supported. (Although it would be quite easy to extend)

Core version: 7
Link to sandbox: http://drupal.org/sandbox/netol/1832808

git clone http://git.drupal.org/sandbox/netol/1832808.git commerce_moodle

Reviews of other projects:

Comments

pere orga’s picture

Status: Active » Needs review

Ready for review.

pere orga’s picture

Issue summary: View changes

added notes

paravibe’s picture

Please add a git link.

Manual review:
commerce_moodle.install: please remove unnesessary endings on line 12 and 21.
commerce_moodle.module: line 18, there is no need to specify MENU_NORMAL_ITEM, because it uses by default.
line 66, It should be like this $time = REQUEST_TIME. Don’t use a function time().

paravibe’s picture

Issue summary: View changes

Removed links to drupal.org issues

pere orga’s picture

Issue summary: View changes

added git instructions

pere orga’s picture

Done.

Thanks

pere orga’s picture

Issue summary: View changes

change git instructions to reflect module's short name

pere orga’s picture

Issue summary: View changes

Updated issue summary.

pere orga’s picture

Issue tags: +PAreview: review bonus

Added tag "PAReview: review bonus" after reviewing 3 modules.

pere orga’s picture

Issue summary: View changes

Added reviews of other projects

grisendo’s picture

Status: Needs review » Needs work
Issue tags: -PAreview: review bonus

The theming you are applying is quite strange...
You are using 'commerce_moodle_make_links' function in order to convert the array into a string with some lines with '
'. After that, you use theme_commerce_moodle function for just add a DIV tag with an id. There are many things here to change:

  1. You can still use commerce_moodle_make_links to sanitize stuff. But it should be better to return the array, and join all in theme_commerce_moodle function. Also, don't use a fixed id property, try to generate an auto-incremental one, or just a class... if anyone call this block more than once, then you can avoid duplicated ids.
  2. Please, use theme('commerce_moodle', ... instead of theme_commerce_moodle in line 296, so anyone can override it into his own theme template.
  3. Please, try to let people customize as many as possible :) when no courses, use another theming function (i.e. theme_commerce_moodle_empty) to let the developers change it, or use a variable_set/variable_get (and sanitize HTML to avoid XSS, and translate) to let both developers and admins to customize that text.

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

pere orga’s picture

Status: Needs work » Needs review

Done (I think). Thanks.

pere orga’s picture

Issue summary: View changes

Added another reviewed project

pere orga’s picture

Issue summary: View changes

Add review of other project

pere orga’s picture

Issue tags: +PAreview: review bonus

Adding again the review bonus tag after doing 3 more reviews.

klausi’s picture

Status: Needs review » Needs work
Issue tags: -PAreview: review bonus

manual review:

  1. you project page could be improved: http://drupal.org/node/997024
  2. you could add a helper function that returns you a database connection object for your moodle database, so you don't have to duplicate that code all the time. And you should then run the queries on that object instead of using db_set_active().
  3. commerce_moodle_commerce_checkout_complete(): does the watchdog() call even work while you changed the database?
  4. "watchdog('Commerce Moodle', "Error inserting enrolment or role assignement for user id '$moodle_user_id' and course id '$moodle_course_id'");": do not concatenate variables into translatable strings, use placeholders with watchdog() instead. This could be considered a small security vulnerability as soon as there is malicious data in $moodle_user_id.
  5. "$courses_array[] = l(check_plain($name), $url);": no need to use check_plain() in l(), double escaping is bad. Please read http://drupal.org/node/28984 again.
  6. "if (!$user->uid || !user_access('view commerce moodle')) {": why do you check the user uid? The permission could be assigned to anonymous users, then they would not have access?

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

pere orga’s picture

  1. Done
  2. Done
  3. Yes, it worked.
  4. Done
  5. Done
  6. Done, but if the user is anonymous he cannot be enrolled to courses. Now anonymous users will see an empty list, unless there's a user in Moodle called 'Anonymous'



Thanks

pere orga’s picture

Issue summary: View changes

Add link to another manual review of another project.

pere orga’s picture

Issue summary: View changes

Another review...

pere orga’s picture

Issue summary: View changes

Another review...

pere orga’s picture

Status: Needs work » Needs review
Issue tags: +PAreview: review bonus

Added tag "PAReview: review bonus" after reviewing 3 more modules.

klausi’s picture

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

Looks RTBC to me now! Removing review bonus tag, you can add it again if you have done another 3 reviews of other projects.

klausi’s picture

Issue summary: View changes

9th review...

pere orga’s picture

Issue summary: View changes

another project...

pere orga’s picture

Issue summary: View changes

idem

pere orga’s picture

Issue summary: View changes

idem

pere orga’s picture

Issue tags: +PAreview: review bonus

Adding the 'PAReview: review bonus' tag again , after 3 more reviews.

klausi’s picture

Status: Reviewed & tested by the community » Fixed

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

Thanks for your contribution, netol!

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.

pere orga’s picture

Status: Fixed » Closed (fixed)

Thanks!
and thanks to all other reviewers as well.

klausi’s picture

Status: Closed (fixed) » Fixed

Just leave it at "fixed", it will close automatically after 2 weeks.

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

Anonymous’s picture

Issue summary: View changes

Changing order of reviewed projects