Cannot redeclare system_update_10101()

Created on 13 June 2024, 5 months ago
Updated 14 June 2024, 5 months ago

When upgrading from 10.0.11 to 10.2.7, the following problems occur: Cannot redeclare system_update_10101()

core/modules/system/system.install

have 2 same functions:

/**
 * Update length of menu_tree fields url and route_param_key from 255 to 2048.
 */
function system_update_10101() {
  $schema = \Drupal::database()->schema();
  $spec = [
    'description' => 'The external path this link points to (when not using a route).',
    'type' => 'varchar',
    'length' => 2048,
    'not null' => TRUE,
    'default' => '',
  ];
  $schema->changeField('menu_tree', 'url', 'url', $spec);

  $spec = [
    'description' => 'An encoded string of route parameters for loading by route.',
    'type' => 'varchar',
    'length' => 2048,
  ];
  $schema->changeField('menu_tree', 'route_param_key', 'route_param_key', $spec);
}

and

/**
 * Change the {batch} table [bid] field to serial.
 */
function system_update_10101(&$sandbox = NULL) {
  $connection = \Drupal::database();
  $schema = $connection->schema();

  // Update batch table.
  if ($schema->tableExists('batch')) {
    $schema->changeField('batch', 'bid', 'bid', [
      'description' => 'Primary Key: Unique batch ID.',
      'type' => 'serial',
      'unsigned' => TRUE,
      'not null' => TRUE,
    ]);
  }

}
💬 Support request
Status

Closed: works as designed

Version

10.2

Component
System 

Last updated 7 days ago

No maintainer
Created by

🇩🇪Germany HeavyStoneHead

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024