Fatal error
PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table '##.field_data_group_audience' doesn't exist: SELECT og.etid as nid FROM {field_data_group_audience} a INNER JOIN {node} n ON a.entity_id = n.nid INNER JOIN {og} og on a.group_audience_gid = og.gid WHERE n.nid = :nid AND n.type NOT IN (:types_0); Array ( [:nid] => ## [:types_0] => ) in subdomain_mode_group->get_content_subdomain() (line 40 of /***************/modules/subdomain/includes/subdomain_mode_group.inc).

og table & field_data_group_audience table doesn't exist http://drupal.org/node/1456356#comment-5653016

fixed by modifying code in below function

 function get_content_subdomain($nid) {
    static $subdomains;
    if (!isset($subdomains[$nid])) {
    /*  $sid = db_query("
        SELECT og.etid as nid
        FROM {field_data_group_audience} a
          INNER JOIN {node} n ON a.entity_id = n.nid
          INNER JOIN {og} og on a.group_audience_gid = og.gid
        WHERE n.nid = :nid AND n.type NOT IN (:types)",
        array(':nid' => $nid, ':types' => _subdomain_filtered_content_types()))
      ->fetchField(); */
$sid = db_query("SELECT gid from og_membership where field_name = 'og_group_ref' AND etid = :nid LIMIT 1",
        array(':nid' => $nid))->fetchField();
$subdomains[$nid] = subdomain_get_subdomain($sid);
    }
    return $subdomains[$nid];
  }
CommentFileSizeAuthor
#1 1895706_1_fix-for-og2.patch1.29 KBadammalone

Comments

adammalone’s picture

Title: compatibility with og 2.x » compatibility with og 2.x [patch attached]
Priority: Major » Critical
StatusFileSize
new1.29 KB

Fix works for me - patchfile attached.

Going to bump to critical as this causes sitewide errors when group setting is on and admin/content unavailable.

adammalone’s picture

Status: Active » Needs review

  • Commit 9fda0d8 on 7.x-2.x by Bobík:
    Issue #1895706: compatibility with og 2.x
    
honza pobořil’s picture

I made some changes and commited it. Could you check dev version, please? If it is ok, mark this issue as fixed.

honza pobořil’s picture

honza pobořil’s picture

Version: 7.x-2.0-beta2 » 7.x-2.x-dev
honza pobořil’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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