diff --git a/core/modules/system/src/Tests/Path/UrlAlterFunctionalTest.php b/core/modules/system/src/Tests/Path/UrlAlterFunctionalTest.php index 39289307ef3dcbef812336221c449825757c10a3..7c3db8671ead629e585c66ec32f2eedf2f4b298f 100644 --- a/core/modules/system/src/Tests/Path/UrlAlterFunctionalTest.php +++ b/core/modules/system/src/Tests/Path/UrlAlterFunctionalTest.php @@ -2,6 +2,7 @@ namespace Drupal\system\Tests\Path; +use Drupal\Core\Database\Database; use Drupal\simpletest\WebTestBase; use Drupal\taxonomy\Entity\Term; @@ -23,6 +24,9 @@ class UrlAlterFunctionalTest extends WebTestBase { * Test that URL altering works and that it occurs in the correct order. */ function testUrlAlter() { + // Ensure that the url_alias table exists after Drupal installation. + $this->assertTrue(Database::getConnection()->schema()->tableExists('url_alias'), 'The url_alias table exists after Drupal installation.'); + $account = $this->drupalCreateUser(array('administer url aliases')); $this->drupalLogin($account); diff --git a/core/modules/system/system.install b/core/modules/system/system.install index 44212b11addb149cf621e80aaf77b09cd0753df9..a02a22374792749ff677657024e1485e96e60c54 100644 --- a/core/modules/system/system.install +++ b/core/modules/system/system.install @@ -7,6 +7,7 @@ use Drupal\Component\Utility\Crypt; use Drupal\Component\Utility\Environment; +use Drupal\Core\Path\AliasStorage; use Drupal\Core\Url; use Drupal\Core\Database\Database; use Drupal\Core\DrupalKernel; @@ -982,6 +983,11 @@ function system_schema() { ), ); + // Create the url_alias table. The alias_storage service can auto-create its + // table, but this relies on exceptions being thrown. These exceptions will be + // thrown every request until an alias is created. + $schema['url_alias'] = AliasStorage::schemaDefinition(); + return $schema; }