In a new drupal install, i installed UTL and created league, division and teams.
I created some games, submitted the results and i ran cron. The result was this error:

Table 'league.content_field_ult_leaguestatus' doesn't exist query: Select a.nid from content_type_ult_division a, content_field_ult_leaguestatus b where a.nid = b.nid and b.field_ult_leaguestatus_value = "Active" in /home/theodim/web/league/sites/all/modules/ULT/modules/ult_standings/ult_standings.module on line 358.

And in the standings page, i get this

No Standings Available

.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jthorson’s picture

Thanks for the report!

My first guess is that the combination of modules you've enabled has flushed out a built-in dependency I didn't consider ... Can you confirm whether or not you've enabled the 'ult_registration' module?

jthorson’s picture

Status: Active » Needs review
FileSize
1020 bytes

Patch attached ... fix commited to 6.x-1.x-dev.

Liakoni’s picture

My first guess is that the combination of modules you've enabled has flushed out a built-in dependency I didn't consider ... Can you confirm whether or not you've enabled the 'ult_registration' module?

Yes, i don't have ULT_Registration module enable. I'll try with the patch.

jthorson’s picture

Sounds good ... let me know if it works for you!

mstrelan’s picture

Patch definitely doesn't work. The $table variable is not defined.

jthorson’s picture

That's odd ... The $table variable is defined in lines 346 through 351 of the ult_standings module:

function ult_standings_getactiveleagues($type = 'league') {
  if ($type == 'league') {
    $table = 'content_type_ult_league';
  }
  elseif ($type == 'division') {
    $table = 'content_type_ult_division';
  }
  else {
    watchdog('ult_standings', t('Illegal "type" value passed into ult_standings_getactiveleagues'));
    return array();
  }
  $lids = array();
  if (module_exists('ult_registration')) {
    $sql = 'Select a.nid from {' . $table . '} a, {content_field_ult_leaguestatus} b where a.nid = b.nid and b.field_ult_leaguestatus_value = "Active" ';
  }
  else {
    // If ult_registrations not installed, there is no 'status' table.
    // Assume all leagues are 'active'
    $sql = 'Select nid from {' . $table . '}';
  }
  $result = db_query($sql);
  while ($data = db_fetch_object($result)) {
    $lids[] = $data->nid;
  }
  if (count($lids) > 0) {
    return $lids;
  }
  else {
    return FALSE;
  }
}

This function is only called from two places ... lines 153 and 157 of ult_standings.module. One instance calls it with no arguments (which causes the default $type="league" argument to be assumed), and the other calls it with the argument "division". Therefore, one of the first two 'if' conditions should always be invoked, and thus the $table variable should always be defined.

I wonder if perhaps the patch didn't apply properly (or was applied against an earlier version of the code) ... Can you verify that your resulting function looks like the above, after the patch has been applied?

mstrelan’s picture

I think you're looking at the wrong function. The patch makes changes to ult_standings_getcurrentsession() however you're referring to ult_standings_getactiveleagues()

jthorson’s picture

Yup ... you're right ... the patch is applying against the wrong function. Not sure how that happened ... I'll re-roll and get something back here in about 20 minutes.

jthorson’s picture

Updated patch ... let me know if it works, and sorry for the trouble!

mstrelan’s picture

Status: Needs review » Reviewed & tested by the community

Works well, thanks

jthorson’s picture

Status: Reviewed & tested by the community » Fixed

Reverted bad patch and applied new one ... fix commited to 6.x-1.x.

Thanks for the heads up!

Status: Fixed » Closed (fixed)

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

jthorson’s picture

Status: Closed (fixed) » Fixed

This fix was incomplete ... also see the patch posted at http://drupal.org/node/1529370#comment-5884418

Status: Fixed » Closed (fixed)

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