When I try to visit http://sunradio.local/dr61/userpoints, I just see a white screen.
Returning to the previous shown page, I see the following error messages:

Warning: Parameter 2 to theme_userpoints_list_users() expected to be a reference, value given in theme() (line 617 of /Library/WebServer/Documents/dr61/includes/theme.inc).
Warning: Parameter 2 to theme_userpoints_list_users() expected to be a reference, value given in theme() (line 617 of /Library/WebServer/Documents/dr61/includes/theme.inc).

Comments

mikejonesok’s picture

Same here. PHP issue?

kbahey’s picture

Can you please try the latest -dev and see if it has the same issue?

mikejonesok’s picture

Priority: Normal » Minor
Status: Active » Fixed

I am not getting the problem anyone it seems. I did cleared the cache and it seemed to be error free. I keep you posted, but great module. Thanks

J-Chance’s picture

Version: 6.x-1.1 » 6.x-1.x-dev
Component: Code: userpoints_views » Code: userpoints_basic
Priority: Minor » Normal
Status: Fixed » Active

I am still getting the issue. Please advise. i cleared the cache as well.

kbahey’s picture

Component: Code: userpoints_basic » Code: userpoints API

Check your web server's error log and Drupal's watchdog. They may have a clue.

J-Chance’s picture

I found the answer here:

http://groups.drupal.org/node/15653

It was because i am using PHP 3. I needed to edit the userpoints.module file to remove all instances of "&$" before a variable and replace them with "$". Thanks anyway.

kbahey’s picture

Status: Active » Fixed

You should not be using PHP 3. Not even PHP 4 which is no longer supported. And that fix is not really a fix. It has side effects and the module may not work in some cases.

heine’s picture

Status: Fixed » Active

I doubt you could run Drupal on PHP 3. You probably mean 5.3?

J-Chance’s picture

That is exactly what i meant. Sorry. I meant 5.3. Do you have another suggestion if that is not a fix?

kbahey’s picture

The &$X syntax is a "by reference" thing. This means that variables can be modified. If you remove the &, then variables will be passed by value, and therefore any modifications to them by that function will not be passed back. I don't have the time to look in the code and see if it really modifies anything. But that gives you a clue on what to look for.

sivaji_ganesh_jojodae’s picture

Title: WSOD » Users by points page (/userpoints) causes white screen of death
Priority: Normal » Critical
Status: Active » Needs review
StatusFileSize
new32.53 KB

Upgrading to recent dev version didn't fix this issue for me.

replacing function theme_userpoints_list_users($header, &$rows, &$tid, &$pager_limit) { with function theme_userpoints_list_users($header, $rows, $tid, $pager_limit) { in userpoints.module did wonders.

Developers note:

function theme_userpoints_list_users($header, &$rows, &$tid, &$pager_limit) {
  // If there is only one category, there is no sense in display the category filter dropdown
  if (count(userpoints_get_categories()) > 1) {
    $output = drupal_get_form('userpoints_filter_cat_select', 'userpoints/', $tid);
    $output .= theme('table', $header, $rows);
    $output .= theme('pager', NULL, $pager_limit, 0);
  }
  else {
    $output = theme('table', $header, $rows);
    $output .= theme('pager', NULL, $pager_limit, 0);
  }
  return $output;
}

In function theme_userpoints_list_users() why do you want to pass arguments as reference when it is not making any modifications ? (correct me if i am wrong)

I am sorry your IDE (or mine) is not configured to use 2 space indentation and trailing white space removal.

Adding better title. I can hardly use it with this bug so bumping to critical.

kbahey’s picture

Status: Needs review » Postponed (maintainer needs more info)

Are you using PHP 5.3?

sivaji_ganesh_jojodae’s picture

Status: Postponed (maintainer needs more info) » Needs review
Issue tags: +PHP 5.3

yes.

avpaderno’s picture

Status: Needs review » Active
berdir’s picture

Status: Active » Needs work

The fix is correct, theme functions are not supposed by receive by reference arguments.

However, the patch contains ~1000 unrelated whitespace changes, which really should be handled in a separate patch. Can you do a simple reroll with just the theme function argument changes?

avpaderno’s picture

It doesn't seem the patch resolves the issue; as far as I can see, it just fixes some formatting issues, which are not the topic of this report.

berdir’s picture

Status: Needs work » Needs review
StatusFileSize
new1.14 KB

You are of course right :)

Attaching a working patch. Simple enough and should be ready to be commited.

avpaderno’s picture

Status: Needs review » Reviewed & tested by the community

It's a nice patch.

wiifm’s picture

Works for me, can we get this patch in ASAP and roll a new DEV release ?

kbahey’s picture

Status: Reviewed & tested by the community » Fixed

Fixed.

New dev release should be available around 12 hours from now.

Status: Fixed » Closed (fixed)
Issue tags: -PHP 5.3

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