diff --git a/composer.json b/composer.json index 22473890..3f314a2c 100644 --- a/composer.json +++ b/composer.json @@ -50,7 +50,7 @@ "shlinkio/shlink-common": "dev-main#b889f5d as 3.5", "shlinkio/shlink-config": "^1.0", "shlinkio/shlink-event-dispatcher": "^2.0", - "shlinkio/shlink-importer": "^2.1", + "shlinkio/shlink-importer": "dev-main#b6fc81f as 2.2", "shlinkio/shlink-installer": "dev-develop#1ed5ac8 as 5.4", "shlinkio/shlink-ip-geolocation": "^1.5", "symfony/console": "^5.1", diff --git a/module/Core/src/Entity/ShortUrl.php b/module/Core/src/Entity/ShortUrl.php index 84c74874..53215a68 100644 --- a/module/Core/src/Entity/ShortUrl.php +++ b/module/Core/src/Entity/ShortUrl.php @@ -89,6 +89,7 @@ class ShortUrl extends AbstractEntity ShortUrlInputFilter::LONG_URL => $url->longUrl(), ShortUrlInputFilter::DOMAIN => $url->domain(), ShortUrlInputFilter::TAGS => $url->tags(), + ShortUrlInputFilter::TITLE => $url->title(), ShortUrlInputFilter::VALIDATE_URL => false, ]; if ($importShortCode) { diff --git a/module/Core/test-db/Repository/ShortUrlRepositoryTest.php b/module/Core/test-db/Repository/ShortUrlRepositoryTest.php index cf38d5a6..29694867 100644 --- a/module/Core/test-db/Repository/ShortUrlRepositoryTest.php +++ b/module/Core/test-db/Repository/ShortUrlRepositoryTest.php @@ -418,7 +418,7 @@ class ShortUrlRepositoryTest extends DatabaseTestCase public function importedShortUrlsAreSearchedAsExpected(): void { $buildImported = static fn (string $shortCode, ?String $domain = null) => - new ImportedShlinkUrl('', 'foo', [], Chronos::now(), $domain, $shortCode); + new ImportedShlinkUrl('', 'foo', [], Chronos::now(), $domain, $shortCode, null); $shortUrlWithoutDomain = ShortUrl::fromImport($buildImported('my-cool-slug'), true); $this->getEntityManager()->persist($shortUrlWithoutDomain); diff --git a/module/Core/test/Entity/ShortUrlTest.php b/module/Core/test/Entity/ShortUrlTest.php index 3cd607da..fceba3e2 100644 --- a/module/Core/test/Entity/ShortUrlTest.php +++ b/module/Core/test/Entity/ShortUrlTest.php @@ -64,7 +64,7 @@ class ShortUrlTest extends TestCase { yield 'no custom slug' => [ShortUrl::createEmpty()]; yield 'imported with custom slug' => [ - ShortUrl::fromImport(new ImportedShlinkUrl('', '', [], Chronos::now(), null, 'custom-slug'), true), + ShortUrl::fromImport(new ImportedShlinkUrl('', '', [], Chronos::now(), null, 'custom-slug', null), true), ]; } diff --git a/module/Core/test/Importer/ImportedLinksProcessorTest.php b/module/Core/test/Importer/ImportedLinksProcessorTest.php index 174e9afc..c294ffe5 100644 --- a/module/Core/test/Importer/ImportedLinksProcessorTest.php +++ b/module/Core/test/Importer/ImportedLinksProcessorTest.php @@ -58,9 +58,9 @@ class ImportedLinksProcessorTest extends TestCase public function newUrlsWithNoErrorsAreAllPersisted(): void { $urls = [ - new ImportedShlinkUrl('', 'foo', [], Chronos::now(), null, 'foo'), - new ImportedShlinkUrl('', 'bar', [], Chronos::now(), null, 'bar'), - new ImportedShlinkUrl('', 'baz', [], Chronos::now(), null, 'baz'), + new ImportedShlinkUrl('', 'foo', [], Chronos::now(), null, 'foo', null), + new ImportedShlinkUrl('', 'bar', [], Chronos::now(), null, 'bar', 'foo'), + new ImportedShlinkUrl('', 'baz', [], Chronos::now(), null, 'baz', null), ]; $expectedCalls = count($urls); @@ -80,11 +80,11 @@ class ImportedLinksProcessorTest extends TestCase public function alreadyImportedUrlsAreSkipped(): void { $urls = [ - new ImportedShlinkUrl('', 'foo', [], Chronos::now(), null, 'foo'), - new ImportedShlinkUrl('', 'bar', [], Chronos::now(), null, 'bar'), - new ImportedShlinkUrl('', 'baz', [], Chronos::now(), null, 'baz'), - new ImportedShlinkUrl('', 'baz2', [], Chronos::now(), null, 'baz2'), - new ImportedShlinkUrl('', 'baz3', [], Chronos::now(), null, 'baz3'), + new ImportedShlinkUrl('', 'foo', [], Chronos::now(), null, 'foo', null), + new ImportedShlinkUrl('', 'bar', [], Chronos::now(), null, 'bar', null), + new ImportedShlinkUrl('', 'baz', [], Chronos::now(), null, 'baz', null), + new ImportedShlinkUrl('', 'baz2', [], Chronos::now(), null, 'baz2', null), + new ImportedShlinkUrl('', 'baz3', [], Chronos::now(), null, 'baz3', null), ]; $contains = fn (string $needle) => fn (string $text) => str_contains($text, $needle); @@ -110,11 +110,11 @@ class ImportedLinksProcessorTest extends TestCase public function nonUniqueShortCodesAreAskedToUser(): void { $urls = [ - new ImportedShlinkUrl('', 'foo', [], Chronos::now(), null, 'foo'), - new ImportedShlinkUrl('', 'bar', [], Chronos::now(), null, 'bar'), - new ImportedShlinkUrl('', 'baz', [], Chronos::now(), null, 'baz'), - new ImportedShlinkUrl('', 'baz2', [], Chronos::now(), null, 'baz2'), - new ImportedShlinkUrl('', 'baz3', [], Chronos::now(), null, 'baz3'), + new ImportedShlinkUrl('', 'foo', [], Chronos::now(), null, 'foo', null), + new ImportedShlinkUrl('', 'bar', [], Chronos::now(), null, 'bar', null), + new ImportedShlinkUrl('', 'baz', [], Chronos::now(), null, 'baz', 'foo'), + new ImportedShlinkUrl('', 'baz2', [], Chronos::now(), null, 'baz2', null), + new ImportedShlinkUrl('', 'baz3', [], Chronos::now(), null, 'baz3', 'bar'), ]; $contains = fn (string $needle) => fn (string $text) => str_contains($text, $needle);