After updating from version beta4 to beta5 I have this error when creating a new event:

PDOException : SQLSTATE[42S22]: Column not found: 1054 Unknown column 'm.weight' in 'field list': SELECT m.id AS id, m.label AS label, m.points AS points, m.class_icon AS class_icon, m.type AS type, m.weight AS weight FROM {league_event_type} m WHERE (m.active = :db_condition_placeholder_0) AND (m.public = :db_condition_placeholder_1) ORDER BY weight ASC; Array ( [:db_condition_placeholder_0] => 1 [:db_condition_placeholder_1] => 1 ) dans league_event_load_event_types() (ligne 738 dans /var/www/sport/sites/all/modules/league/modules/league_event/league_event.module).
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

lebodyguard’s picture

Testing my first patch in drupal :)

lebodyguard’s picture

Status: Active » Needs review
hatuhay’s picture

Hello,
Congratulations for the patch!!
But the real problem is that for some reason -I have to check- your database has not been updated.
The field weight could be found on the league_event schema in the league_event.intall file, apparently it is not present on your database.
Please assure that your system run all pending updates.
Keep me posted.

hatuhay’s picture

Status: Needs review » Closed (works as designed)

I double check on uploaded files, you have to run database updates and problem should be gone.
Please reopen if problem persist.

lebodyguard’s picture

I don't know if I did something wrong but I did run the database update but the problem perssist.
this is what I have in league_event.install file for league_event schema:

 $schema['league_event'] = array(
    'description' => 'The base table for league_event entries.',
    'fields' => array(
      'id' => array(
        'type' => 'serial',
        'not null' => TRUE,
        'description' => 'Primary Key: Unique league_event type identifier.',
      ),
      'game_id' => array(
        'description' => 'ID of the game',
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
      'type' => array(
        'description' => 'The machine-readable name of this league_event type.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
      ),
      'team_id' => array(
        'description' => 'ID of the team',
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
      'minute' => array(
        'description' => 'Minute',
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
      'points' => array(
        'description' => 'Number of points for this league_event',
        'type' => 'int',
        'not null' => TRUE,
        'default' => 1,
      ),
      'person_id' => array(
        'description' => 'ID of the person',
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
      'comment' => array(
        'description' => 'Comment for the event',
        'type' => 'varchar', 
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),     
    ),
    'primary key' => array('id'),
    'indexes' => array(
      'type' => array('type'),
      'game_id' => array('game_id'),
      'team_id' => array('team_id'),
      'person_id' => array('person_id'),
    ),
  );

there is no weight record
the weight is in the event_type shema

'weight' => array(
        'description' => 'Weight to allow order in lists',
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
lebodyguard’s picture

Status: Closed (works as designed) » Needs review
lebodyguard’s picture

solved by creating manualy (with phpmyadmin) the weight record in "league_event_type" table

lebodyguard’s picture

Status: Needs review » Closed (works as designed)