Upgrading to php-5.3 renders tac_lite (thus the whole site) unusable with barking like these:

warning: Parameter 1 to tac_lite_node_grants() expected to be a reference, value given in /path/to/drupal/includes/module.inc on line 471.

Removing the ampersands from tac_lite_node_grants()'s definition renders tac_lite (thus the site) usable again - which is what the attached patch does.

CommentFileSizeAuthor
#7 tac_lite-patch-v2.patch1015 bytesPete Harlan
tac_lite-php-5.3.patch457 bytesBoobaa
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Anonymous’s picture

Version: 6.x-1.3 » 6.x-1.2

I can confirm that I also was getting the above errors and users could not access pages with tac_lite applied by role. Above patch worked. I was however using 1.x-1.2

markj’s picture

6.x-1.3 also gives the error reported above, and the patch fixes it.

Berdir’s picture

Status: Needs review » Reviewed & tested by the community

I haven't tested the patch, but the change looks OK.

james.cartledge’s picture

I can confirm this. I found it independently and came here to post the patch.

Andrew Schulman’s picture

subscribing

ducdebreme’s picture

I have tested the patch successfully on 5.3.2-1ubuntu4.2
without the patch, i got the error message. After applying it disappeared and Taxonomy Access Control Lite worked correctly.

Pete Harlan’s picture

FileSize
1015 bytes

Shouldn't _tac_lite_user_tids() be similarly modified, since tac_lite_node_grants() passes $account to it?

Patch attached containing both modifications. Comments welcome.

Boobaa’s picture

Status: Reviewed & tested by the community » Needs review

Patch looks good, but needs review.

Anonymous’s picture

Latest patch works for me on PHP 5.3.2 and Drupal 6.17

Boobaa’s picture

Status: Needs review » Reviewed & tested by the community

Douggough forgot to RTBC this in #9.

Dave Cohen’s picture

Version: 6.x-1.2 » 6.x-1.x-dev
Status: Reviewed & tested by the community » Fixed

thanks for the patch and for your patience. Checked into DRUPAL-6--1 branch.

Status: Fixed » Closed (fixed)

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

Renee S’s picture

Hi Dave,

Thanks for checking this in; I downloaded the latest dev release and two of the functions are fixed, but the third function (which was correct in the patch) looks like:

function tac_lite_node_grants($account, &$op) {

instead of:

function tac_lite_node_grants($account, $op) {

When I fixed that, it worked great.

DREAMER_ES’s picture

Hi all,
I used the latest dev version and where having the same error.

After changed the line that renee suggested, and that was causing an error logged in the watchdog, it worked as expected.
Thanks all! :D

Renee S’s picture

Status: Closed (fixed) » Needs work

Gonna make this active again so it'll get seen :)

Dave Cohen’s picture

Status: Needs work » Fixed

Sorry about that. I think I have it right now.

Status: Fixed » Closed (fixed)

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

dankh’s picture

Sorry for reopening this, but please can you put on the module description page that users with PHP 5.3 has to install the current dev version. I was thinking that the warning doesn't break the module, but it does. I'm installing this module for the first time and I wasted 2 hours to understand what I'm not doing right, but then I installed the dev version and everything worked as expected.

Thanks,

faqing’s picture

Once I deleted the "&". the message disappeared.

Dave Cohen’s picture

I've never been able to run Drupal 6.x on PHP 5.3. What's the story? Does Drupal 6 support php 5.3 now?

Renee S’s picture

I'm on 5.3. The latest release - 6.19 - appeared to support it without requiring any patching of core. A few contrib modules don't, but I've been able to work around all of them, and most have patches in their issue queues if not commits. It's mostly minor stuff.

faqing’s picture

My server is Ubuntu 10.4 and my PHP Version is 5.3.2-1ubuntu4.5. My Drupal is 6.19
My tac_lit is recent dev version.
After I deleted the &

function tac_lite_node_grants($account, &$op) {

it works OK.

ndrini’s picture

Issue summary: View changes

To explain better.

To solve this warning, you can delete the & symbols
there're in function tac_lite_node_grants

The function tac_lite_node_grants($account, $op) is
in line 446 of modules/tac_lite/tac_lite.module

/**
 * Implementation of hook_node_grants
 * 
 * Returns any grants which may give the user permission to perform the
 * requested op.
 */
function tac_lite_node_grants($account, $op) {
  $grants = array();
  for ($i = 1; $i <= variable_get('tac_lite_schemes', 1); $i++) {
    $config = _tac_lite_config($i);
    if (in_array('grant_' . $op, $config['perms'])) {
      $grants[$config['realm']] = _tac_lite_user_tids($account, $i);
    }
  }
  if (count($grants))
    return $grants;
}