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 »
  • Upgrading CiviCRM (Moderator: Deepak Srivastava) »
  • CiviMember Roles Sync
Pages: [1]

Author Topic: CiviMember Roles Sync  (Read 638 times)

mcarson

  • I post occasionally
  • **
  • Posts: 110
  • Karma: 5
  • CiviCRM version: 4.4.4
  • CMS version: Drupal 7.x
  • MySQL version: 5.5
  • PHP version: 5.4.22
CiviMember Roles Sync
January 05, 2013, 05:12:43 am
I have just upgraded our site to Drupal 7 and CiviCRM 4.2.6.

I enabled the CiviMember Roles Sync module. After attempting to add a new rule I encountered the following error:
Code: [Select]
PDOException: SQLSTATE[HY000]: General error: 1364 Field 'rule_id' doesn't have a default value:
INSERT INTO {civicrm_member_roles_rules} (rid, type_id, status_codes) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2);
Array ( [:db_insert_placeholder_0] => 13
[:db_insert_placeholder_1] => 6
[:db_insert_placeholder_2] => a:4:{i:0;s:7:"current";i:1;s:7:"expired";s:7:"current";a:12:{i:0;s:1:"1";i:1;s:1:"2";i:2;s:1:"3";i:3;s:1:"5";i:4;s:1:"8";i:5;s:2:"10";i:6;s:2:"11";i:7;s:2:"12";i:8;s:2:"13";i:9;s:2:"14";i:10;s:2:"15";i:11;s:2:"18";}s:7:"expired";a:3:{i:0;s:1:"4";i:1;s:1:"7";i:2;s:1:"9";}} )
in civicrm_member_roles_add_rule_form_submit() (line 443 of /var/www/vhosts/.../sites/all/modules/civicrm/drupal/modules/civicrm_member_roles/civicrm_member_roles.module).

Any idea what's going on and how I might debug/fix this?
“Anyone who has never made a mistake has never tried anything new.” - Albert Einstein
"If you are travelling at the speed of light and you turn on your headlights, would they work?" - Unknown

mcarson

  • I post occasionally
  • **
  • Posts: 110
  • Karma: 5
  • CiviCRM version: 4.4.4
  • CMS version: Drupal 7.x
  • MySQL version: 5.5
  • PHP version: 5.4.22
Re: CiviMember Roles Sync
January 05, 2013, 06:41:27 am
It seems as if the CiviMember Roles Sync was installed at some point in the past and then disabled!

The civicrm_member_roles_rules table exists, but does not match the schema in the civicrm_member_roles.install file:

Existing table:
Code: [Select]
# Column Type Collation Attributes Null Default
1 rule_id int(10) UNSIGNED No None
2 rid int(10) UNSIGNED No None
3 type_id int(10) UNSIGNED No None
4 status_codes text utf8_general_ci No None

Schema:
Code: [Select]
$schema['civicrm_member_roles_rules'] = array(
    'fields' => array(
      'rule_id' => array(
        'type' => 'serial',
      ),
      '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'),
  );

There are no records in the table! Could I just disable the module, delete the table; then re-enable the module?
“Anyone who has never made a mistake has never tried anything new.” - Albert Einstein
"If you are travelling at the speed of light and you turn on your headlights, would they work?" - Unknown

mcarson

  • I post occasionally
  • **
  • Posts: 110
  • Karma: 5
  • CiviCRM version: 4.4.4
  • CMS version: Drupal 7.x
  • MySQL version: 5.5
  • PHP version: 5.4.22
Re: CiviMember Roles Sync
January 06, 2013, 02:02:34 am
 :-[ Fixed now; uninstalled, then re-enabled the module. Dunno why it didn't work before.
“Anyone who has never made a mistake has never tried anything new.” - Albert Einstein
"If you are travelling at the speed of light and you turn on your headlights, would they work?" - Unknown

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Upgrading CiviCRM (Moderator: Deepak Srivastava) »
  • CiviMember Roles Sync

This forum was archived on 2017-11-26.