Hello!

So I have downloaded and tested both the stable and dev versions of Registration Code for D6 and I am running in to an error when I am on the admin page (/admin/user/regcode/og) for regcode_og. This error occurred with the stable build (2.7) as well.

user warning: Unknown column 'dr_regcode_og.tid' in 'on clause' query: SELECT id, term_data.name AS term, regcode_og.og AS ogid FROM dr_regcode_og AS regcode_og LEFT JOIN dr_term_data AS term_data ON dr_regcode_og.tid = term_data.tid in /sites/all/modules/regcode/regcode_og/regcode_og.module on line 151.

My DB has tid fields all tables mentioned... Is is that it is not relating terms properly?

Any help would be appreciated, as I must stay with D6 for a while and would love to use this module!

Thanks!

- Josh

CommentFileSizeAuthor
#7 1235574-add-to-organic-groups-7.patch658 bytesshaundychko

Comments

aidanlis’s picture

Status: Active » Postponed (maintainer needs more info)

Still an issue?

lunazoid’s picture

I just installed this module to try it out with organic groups, and am getting the same error:

user warning: Unknown column 'drupal_regcode_og.tid' in 'on clause' query: SELECT id, term_data.name AS term, regcode_og.og AS ogid FROM drupal_regcode_og AS regcode_og LEFT JOIN drupal_term_data AS term_data ON drupal_regcode_og.tid = term_data.tid in C:\xampp\htdocs\groups1\sites\all\modules\regcode\regcode_og\regcode_og.module on line 151.

(tested with the latest dev release)

lunazoid’s picture

The problem seems to be in the regcode_og.module file in the way the query is defined at line 147. Currently, it is

  $query = 'SELECT id, term_data.name AS term, regcode_og.og AS ogid
            FROM {regcode_og} AS regcode_og
            LEFT JOIN {term_data} AS term_data ON {regcode_og.tid = term_data.tid}';

and it should (probably) be

  $query = 'SELECT id, term_data.name AS term, {regcode_og.og} AS ogid
            FROM {regcode_og} AS {regcode_og}
            LEFT JOIN {term_data} AS term_data ON {regcode_og.tid = term_data.tid}';

(note the curly brackets.) I'm not getting the error message after making this change, and it appears to be working. It's probably just an issue when using table prefixes.

aidanlis’s picture

lunazoid, no, using curlies in the alias is completely wrong.

The problem is {regcode_og.tid = term_data.tid} should be "regcode_og.tid = term_data.tid", e.g. removing the curlies from the join condition.

lunazoid’s picture

Thanks. That seems to be working.

aidanlis’s picture

Status: Postponed (maintainer needs more info) » Needs review
shaundychko’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new658 bytes

Here's a patch containing #4 to help speed this along.

tr’s picture

Issue summary: View changes
Status: Reviewed & tested by the community » Closed (outdated)

This code was removed from the regcode_og module almost 10 years ago, in #1214458: OG integration broken.

Drupal 6 is unsupported and has been unsupported for more than 5 years. Changes will no longer be made to the D6 version of this module.