Answers.Body: <p>Drupal 7.76 was only current for about a day, because of this bug (which affects other integrations, but hits CiviCRM especially hard). Upgrade to Drupal 7.77.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-01-08T23:36:12.767Z
Answers.Text: Thanks, I must have had particularly bad timing.  Will do.  I saw things about "table name quoting for MySQL 8" in the release notes for 7.77, but figured it didn't apply since I'm using mysql 5.7.x.
Answers.UserDisplayName: Ken Williams
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-01-07T06:44:21.603Z
Answers.LastActivityDate: 2021-01-07T06:44:21.603Z
Answers.UserDisplayName: Jon G - Megaphone Tech
Body: <p>When I log in to my site and I have the <code>civicrm_group_roles</code> module enabled, I'm getting this generic error in the browser:</p>
  <pre><code>Error
  The website encountered an unexpected error. Please try again later.
  </code></pre>
  <p>In the database log, I see this error message:</p>
  <pre><code>PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table
  'singersin_drupal.singersin_combined.civicrm_group_roles_rules' doesn't exist:
  SELECT r.name AS name, cgr.role_id AS role_id, cgr.group_id AS group_id FROM 
  {civicrm_group_roles_rules} cgr INNER JOIN {role} r ON r.rid=cgr.role_id; Array ( ) in 
  civicrm_group_roles_sync_roles() (line 821 of 
  /Users/ken/src/SIA/server275-site/sites/all/modules/civicrm/drupal/modules/civicrm_group_roles/civicrm_group_roles.module).
  </code></pre>
  <p>Note the table name <code>singersin_drupal.singersin_combined.civicrm_group_roles_rules</code> - that's actually the <strong>Drupal</strong> database name, followed by the <strong>CiviCRM</strong> database name, followed by the table it's looking for.  So I assume that somehow the <code>{civicrm_group_roles_rules}</code> token is getting filled in wrong when the site has different databases for Drupal and CiviCRM.</p>
  <p>I can work around this by disabling the <code>civicrm_group_roles</code> module (<code>drush dis civicrm_group_roles</code>).</p>
  <p>I'm using:</p>
  <ul>
  <li>CiviCRM 5.32.2</li>
  <li>Drupal 7.76</li>
  </ul>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-01-07T04:02:59.083Z
Comments.Text: Just noticed I didn't *exactly* ask a question.  The question is: how can I fix this, and/or should I open a bug in the CiviCRM tracker somewhere?
Comments.UserDisplayName: Ken Williams
Tags: <drupal><database><modules><plugin><bug-reporting>
Title: DB error in 'civicrm_group_roles' module
ThreadText: # DB error in 'civicrm_group_roles' module
  
  (Asked by: username_0 on 2021-01-06)
  
  When I log in to my site and I have the `civicrm_group_roles` module enabled, I'm getting this generic error in the browser:
  
  ```
  Error
  The website encountered an unexpected error. Please try again later.
  
  ```
  
  In the database log, I see this error message:
  
  ```
  PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table
  'singersin_drupal.singersin_combined.civicrm_group_roles_rules' doesn't exist:
  SELECT r.name AS name, cgr.role_id AS role_id, cgr.group_id AS group_id FROM 
  {civicrm_group_roles_rules} cgr INNER JOIN {role} r ON r.rid=cgr.role_id; Array ( ) in 
  civicrm_group_roles_sync_roles() (line 821 of 
  /Users/ken/src/SIA/server275-site/sites/all/modules/civicrm/drupal/modules/civicrm_group_roles/civicrm_group_roles.module).
  
  ```
  
  Note the table name `singersin_drupal.singersin_combined.civicrm_group_roles_rules` - that's actually the **Drupal** database name, followed by the **CiviCRM** database name, followed by the table it's looking for. So I assume that somehow the `{civicrm_group_roles_rules}` token is getting filled in wrong when the site has different databases for Drupal and CiviCRM.
  
  I can work around this by disabling the `civicrm_group_roles` module (`drush dis civicrm_group_roles`).
  
  I'm using:
  
  * CiviCRM 5.32.2
  * Drupal 7.76
  
  **Tags:** drupal, database, modules, plugin, bug-reporting
  
  > **Comments:**
  > **username_0**: Just noticed I didn't *exactly* ask a question.  The question is: how can I fix this, and/or should I open a bug in the CiviCRM tracker somewhere?  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2021-01-07. Score: 0 | Accepted answer
  
  Drupal 7.76 was only current for about a day, because of this bug (which affects other integrations, but hits CiviCRM especially hard). Upgrade to Drupal 7.77.
  
  > **Comments:**
  > **username_0**: Thanks, I must have had particularly bad timing.  Will do.  I saw things about "table name quoting for MySQL 8" in the release notes for 7.77, but figured it didn't apply since I'm using mysql 5.7.x.  
  
  ---
  
  