Cannot redeclare system_update_10101()

Created on 13 June 2024, 3 months ago
Updated 14 June 2024, 3 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 1 day 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