I did cleanup the .install file and fixed various coding style issues. This was comitted with a pull request to github by me.

Things to mention:

  $schema['content_moderation_states'] = array(
    'description' => t('Defines all possible states'),
    'fields'    => array(
      'name'    => array('type' => 'varchar', 'length' => '255', 'not null' => FALSE),
      'descr'   => array('type' => 'varchar', 'length' => '255', 'not null' => FALSE),
      'weight'  => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0, 'size' => 'small'),
    ),
    'unique keys' => array('name' => array('name'))
  );

The column weight was not set before my fix. Please note that on install hook_update is NOT fired! By this any current new installations will not have a weight column! I did test this on my stage. The schema must always contain the full data. All fields that are created by an update must be present in the schema as well.

function _content_moderation_insert_values() {
  $states[] = array('name' => 'none');
//..
  foreach($states as $state) {
    // See http:// drupal. org/node/568640 to change this after it's fixed.
    db_query('INSERT INTO {content_moderation_states} (`name`) VALUES("%s")', $state);
    //drupal_write_record('content_moderation_states', $state);
  }
//..
}

I changed this to equally coded loops. Sadly we can't currently use drupal_write_record due to the issue I linked.

All other changes where cosmetically.

Comments

eugenmayer’s picture

Status: Needs review » Fixed

Thank you a lot Karsten for the contribution. Will be included in the next release!

eugenmayer’s picture

Status: Fixed » Closed (fixed)

released in in 1.4