Some code needs cleanup.
I found, i.e., that the function referral_validate_multiplier() is written like:

function referral_validate_multiplier($form) {
  if ($form['#value'] >= 0 && $form['#value'] <= 100) {
    return;
  }
  else {
    form_set_error('referral_points_multiplier', t('Percentage multiplier must be between 0 and 100'));
  }
}

where it should be write like:

function referral_validate_multiplier($form) {
  if ($form['#value'] < 0 || $form['#value'] > 100) {
    form_set_error('referral_points_multiplier', t('Percentage multiplier must be between 0 and 100'));
  }
}

Comments

kbahey’s picture

Status: Active » Needs work

Please read http://drupal.org/patch carefully and follow the instructions there on creating proper patches.

This will make reviewing them easier and faster.

kbahey’s picture

Component: Code » Code: referral_points
avpaderno’s picture

Status: Needs work » Needs review
StatusFileSize
new429 bytes
avpaderno’s picture

Component: Code: referral_points » Code
StatusFileSize
new1012 bytes

userpoints_expire still uses the field event, which has been renamed operation. Plus, the Drupal coding standards suggests to use two spaces indentation, without tabs.

avpaderno’s picture

StatusFileSize
new968 bytes
avpaderno’s picture

StatusFileSize
new851 bytes

userpoints_nodelimit_form_alter() completely removes all the fields of the node editing form, which is a "dangerous" operation.
It would be sufficient to remove the form buttons, so the form could not be submitted.

avpaderno’s picture

StatusFileSize
new3.16 KB

userpoints_reserve.module doesn't output well-formed XHTML.

avpaderno’s picture

StatusFileSize
new1.52 KB

In userpoints_retroactive.module the function userpoints_retroactive_page() doesn't even works as it uses a not initialized variable:

function userpoints_retroactive_page() {
  return drupal_get_form('userpoints_retroactive', $form);
}
avpaderno’s picture

userpoints_top_contributors.module, and userpoints_votingapi.module don't use hook_userpoints() to add more settings in the userpoints.module settings form.

kbahey’s picture

Status: Needs review » Closed (won't fix)

Kiam

What you are doing is very confusing.

Please open one issue for each separate problem that has a different patch.

I am closing this issue.

avpaderno’s picture

Shall I open more than one issue for what is just a general cleanup task?

kbahey’s picture

Kiam

If it touches several modules, and each module has a separate patch, then it needs to be in separate issues so they are committed and tracked separately.

If you have one issue with 5 patches for 5 modules, then we can't track things at all.

They cannot be even reviewed separately.

I told you what needs to be done. If you want it committed, then do it the way everyone does it.

jredding’s picture

Just for reference so that you understand the reasoning behind this (other than tracking the patch review/commit status)

Userpoints Contributed modules is a collection of individually submitted modules by many different authors. Because they are small in nature they are offered as a collection instead of individually downloadable modules.

What this means though is that there is not a single maintainer for the collection of modules but almost one maintainer per module within the collection (that is if there is a maintainer at all, which often is not the case). It is much better to provide patches, tasks, issues, etc. against the individual pieces within the collection so that they can be better categorized.

The hope is that once an individual module becomes popular and an individual maintainers comes forward they will be branched out into their own individual modules.
for example
http://drupal.org/project/userpoints_ubercart

avpaderno’s picture

Status: Closed (won't fix) » Postponed
avpaderno’s picture

Status: Postponed » Closed (fixed)

The issue has been spitted in multiple issues, like suggested me to do.
I consider this issue closed.

-- Kiam@AVPnet