I believe this may have been mentioned before, but I still can't update this module.
Running drush updatedb after swapping in the new code results in this:

Cannot change the definition of field <em class="placeholder">registration</em>.<em class="placeholder">state</em>: field doesn't exist.                                   [error]
Performed update: registration_update_7100                                                                                                                                 [ok]
array_keys() expects parameter 1 to be array, null given common.inc:7029                                                                                                   [warning]
array_keys() expects parameter 1 to be array, null given common.inc:7029                                                                                                   [warning]
WD menu: PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'cgshr.registration_type' doesn't exist: SELECT base.*                                    [error]
FROM 
{registration_type} base; Array
(
)
 in EntityAPIController->query() (line 187 of /home/resonetrics/domains/cgshr.resonetrics.com/public_html/sites/all/modules/entity/includes/entity.controller.inc).
in_array() expects parameter 2 to be array, null given entity.module:816                                                                                                   [warning]
Missing database columns for the exportable entity registration_type as defined by entity_exportable_schema_fields(). Update the according module and run update.php!      [warning]
entity.module:817
in_array() expects parameter 2 to be array, null given entity.module:816                                                                                                   [warning]
Missing database columns for the exportable entity registration_state as defined by entity_exportable_schema_fields(). Update the according module and run update.php!     [warning]
entity.module:817

On the site, I get a PDO exception and the site is unusable
Error messagePDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'cgshr.registration_type' doesn't exist: SELECT base.id AS id, base.name AS name, base.label AS label, base.weight AS weight, base.locked AS locked, base.data AS data, base.status AS status, base.module AS module FROM {registration_type} base; Array ( ) in EntityAPIController->query() (line 187 of /home/resonetrics/domains/cgshr.resonetrics.com/public_html/sites/all/modules/entity/includes/entity.controller.inc)

My fix will be (I hope) - roll back to previous snapshot, disable and uninstall registration, install new version. Fortunately this is a new site, with no actual registrations in place as yet - and methinks that may be what's causing the error.

Comments

deanflory’s picture

Version: 7.x-1.2 » 7.x-1.x-dev

I too am now getting these after restoring a backup on a server with updated PHP, etc.

Warning: array_keys() expects parameter 1 to be array, null given in drupal_schema_fields_sql() (line 7102 of /.../includes/common.inc).
Warning: array_keys() expects parameter 1 to be array, null given in drupal_schema_fields_sql() (line 7102 of /.../includes/common.inc).
Warning: array_keys() expects parameter 1 to be array, null given in drupal_schema_fields_sql() (line 7102 of /.../includes/common.inc).
Warning: in_array() expects parameter 2 to be array, null given in _entity_defaults_rebuild() (line 867 of /.../sites/all/modules/entity/entity.module).
User warning: Missing database columns for the exportable entity registration_type as defined by entity_exportable_schema_fields(). Update the according module and run update.php! in _entity_defaults_rebuild() (line 868 of /.../sites/all/modules/entity/entity.module).
Warning: in_array() expects parameter 2 to be array, null given in _entity_defaults_rebuild() (line 867 of /.../sites/all/modules/entity/entity.module).
User warning: Missing database columns for the exportable entity registration_state as defined by entity_exportable_schema_fields(). Update the according module and run update.php! in _entity_defaults_rebuild() (line 868 of /.../sites/all/modules/entity/entity.module).
Warning: Invalid argument supplied for foreach() in entity_metadata_convert_schema() (line 151 of /.../sites/all/modules/entity/entity.info.inc).
Warning: Invalid argument supplied for foreach() in entity_metadata_convert_schema() (line 151 of /.../sites/all/modules/entity/entity.info.inc).
Warning: Invalid argument supplied for foreach() in entity_metadata_convert_schema() (line 151 of /.../sites/all/modules/entity/entity.info.inc).

Registration 7.x-1.3+2-dev
Registration Entity Access 7.x-1.3+2-dev
Registration User Enrollment
Registration Views 7.x-1.3+2-dev
Registration Wait list 7.x-1.3+2-dev

deanflory’s picture

Status: Active » Needs work

Changing this to "Needs work" to garner more attention since this issue is over a year old with no replies.

deanflory’s picture

Completely disabling, uninstalling, removing entries from the forward_statistics table, and then re-enabling seems to have fixed this issue.

bartk’s picture

Here's what I did to address this issue. I went to my mysql command prompt and ran the following:

create table registration_type (
  id serial not null primary key,
  name varchar(32) not null unique,
  label varchar(255) not null,
  weight tinyint not null default 0,
  locked tinyint not null default true,
  default_state varchar(128),
  data longtext,
  status tinyint not null default 1,
  module varchar(255)
);


create table registration_state (
  registration_state_id serial not null primary key,
  name varchar(128) not null unique,
  label varchar(128) not null,
  description longtext,
  default_state tinyint not null default 0,
  active tinyint not null default 0,
  held tinyint not null default 0,
  show_on_form tinyint not null default 0,
  weight integer not null default 0,
  status tinyint not null default 1,
  module varchar(255)
);


create table registration_entity (
  entity_id integer not null,
  entity_type varchar(32) not null default '',
  primary key (entity_id, entity_type),
  capacity integer not null,
  status integer not null default 1,
  send_reminder integer not null default 0,
  reminder_date datetime,
  reminder_template longtext,
  open datetime,
  close datetime,
  settings longblob
);

alter table registration add state varchar(32);

create index registration_state_name on registration_state(name);

create index registration_state_default_state on registration_state(default_state);

After that, the updates ran without any issues. Please note that I haven't tested the module after doing this, so it's possible that there are other problems with this method.

museumboy’s picture

Thanks BartK. You saved my butt.

#4 works for me.

john.oltman’s picture

Status: Needs work » Closed (outdated)