CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviMember (Moderator: Deepak Srivastava) »
  • BUG?: CiviMember Roles Sync module - civicrm_member_roles_rules doesn't exist
Pages: [1]

Author Topic: BUG?: CiviMember Roles Sync module - civicrm_member_roles_rules doesn't exist  (Read 1283 times)

epmcl

  • I’m new here
  • *
  • Posts: 7
  • Karma: 0
BUG?: CiviMember Roles Sync module - civicrm_member_roles_rules doesn't exist
September 03, 2011, 08:10:39 am
When I try to access the CiviMember Roles Sync module or create an Association Rule, I get this error:

user warning: Table 'civicrm-drupal.civicrm_member_roles_rules' doesn't exist query: SELECT * FROM civicrm_member_roles_rules ORDER BY rule_id ASC in /mnt/data-store/www/civcrm/wwwroot/sites/all/modules/civicrm/drupal/modules/civicrm_member_roles/civicrm_member_roles.module on line 133.

I am running:
Drupal 6.16
CiviCRM 3.4.5
CiviMembers Role Sync Module 3.4

I configured the Membership Type in CiviCRM without issue.

Any suggestions or recommendations on resolving this would be greatly appreciated. Please let me know if I can provide any additional detail.

Thanks,

Ed
« Last Edit: September 05, 2011, 10:30:09 am by epmcl »

epmcl

  • I’m new here
  • *
  • Posts: 7
  • Karma: 0
Re: BUG?: CiviMember Roles Sync module - civicrm_member_roles_rules doesn't exist
September 05, 2011, 10:36:51 am
I tried creating the table manually, pulling the schema from the module install file. The create table command fails when defined per the schema.  The problem appears to be related to the definition of the rule_id field. Here's the schema:


Code: [Select]
$schema['civicrm_member_roles_rules'] = array(
'fields' => array(
'rule_id' => array(
   'type' => 'serial',
   'unsigned' => TRUE,
   'not null' => TRUE,
   ),
'rid' => array(
   'type' => 'int',
   'unsigned' => TRUE,
   'not null' => TRUE,
   ),
'type_id' => array(
   'type' => 'int',
   'unsigned' => TRUE,
   'not null' => TRUE,
   ),
'status_codes' => array(
'type' => 'text',
'not null' => TRUE,
),
),
'primary key' => array('rule_id'),
);

And here's what I found:

CREATE TABLE fails on the definition of rule_id field when type=serial and the attribute unsigned=true is defined. If I remove the unsigned=true attribute, the create table operation performs properly.

According to MySQL website: SERIAL is an alias for BIGINT UNSIGNED NOT NULL AUTO_INCREMENT UNIQUE. (http://dev.mysql.com/doc/refman/5.0/en/numeric-type-overview.html)

So it appears that defining the unsigned attribute is redundant. But does the primary key for this table really need to be a bigint? Seems unlikely that there would be more than a few billion CiviMember role association rules defined for any given site. ;)

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: BUG?: CiviMember Roles Sync module - civicrm_member_roles_rules doesn't exist
September 05, 2011, 04:01:35 pm

can you please file an issue and attach the patch for this. Your reasoning seems quite good :)

thanx

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

drupleg

  • I post occasionally
  • **
  • Posts: 39
  • Karma: 2
    • Drupal.org Profile
  • CiviCRM version: 4.1
  • CMS version: Drupal 7
  • PHP version: 5.3
Re: BUG?: CiviMember Roles Sync module - civicrm_member_roles_rules doesn't exist
November 13, 2012, 09:11:25 pm
Hello, I have a Drupal / CiviCRM site that has been through many upgrades.  I started with D6 / CiviCRM 3.x and am now on D7 / CiviCRM 4.2.6.  I ran in to this issue today as I am preparing to use Role sync (previously I've never enabled or used this module until today).  After I got the error I found that by uninstalling the module, either with drush or the UI, then re-enabling the module, this recreated the table properly. So:

Code: [Select]
drush pm-uninstall civicrm_member_roles -y
then

Code: [Select]
drush pm-enable civicrm_member_roles -y
This fixed the error for me.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviMember (Moderator: Deepak Srivastava) »
  • BUG?: CiviMember Roles Sync module - civicrm_member_roles_rules doesn't exist

This forum was archived on 2017-11-26.