From 42034e76d7789a6189bad4ee77f762bbe7aa57d7 Mon Sep 17 00:00:00 2001 From: catch Date: Wed, 9 Oct 2019 11:03:47 +0100 Subject: [PATCH] =?UTF-8?q?Issue=20#3086001=20by=20Krzysztof=20Doma=C5=84s?= =?UTF-8?q?ki,=20alexpott:=20CreateSampleEntityTest::testSampleValueConten?= =?UTF-8?q?tEntity=20can=20randomly=20fail?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/lib/Drupal/Core/Path/PathAliasStorage.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/lib/Drupal/Core/Path/PathAliasStorage.php b/core/lib/Drupal/Core/Path/PathAliasStorage.php index a9db234c458..ed765accbcd 100644 --- a/core/lib/Drupal/Core/Path/PathAliasStorage.php +++ b/core/lib/Drupal/Core/Path/PathAliasStorage.php @@ -43,7 +43,8 @@ class PathAliasStorage extends SqlContentEntityStorage { */ public function createWithSampleValues($bundle = FALSE, array $values = []) { $entity = parent::createWithSampleValues($bundle, ['path' => '/'] + $values); - $entity->set('alias', '/' . $entity->get('alias')->value); + // Ensure the alias is only 255 characters long. + $entity->set('alias', substr('/' . $entity->get('alias')->value, 0, 255)); return $entity; }