Skip to content
Permalink
Browse files

Fix EZP-26344: Publishing URL alias does not always respect reserved …

…names (#1784)
  • Loading branch information...
pspanja committed Sep 21, 2016
1 parent 91afbbe commit 8197e673364963ab9ffd793429e877318a1f2c4d
@@ -117,8 +117,8 @@ public function publishUrlAliasForLocation(
$updatePathIdentificationString = false
) {
$parentId = $this->getRealAliasId($parentLocationId);
$uniqueCounter = $this->slugConverter->getUniqueCounterValue($name, $parentId == 0);
$name = $this->slugConverter->convert($name, 'location_' . $locationId);
$uniqueCounter = $this->slugConverter->getUniqueCounterValue($name, $parentId == 0);
$languageId = $this->languageHandler->loadByLanguageCode($languageCode)->id;
$languageMask = $languageId | (int)$alwaysAvailable;
$action = 'eznode:' . $locationId;
@@ -3073,6 +3073,40 @@ public function testLoadUrlAliasThrowsNotFoundException()
$handler->loadUrlAlias('non-existent');
}
public function providerForTestPublishUrlAliasForLocationSkipsReservedWord()
{
return [
[
'section',
'section2',
],
[
'claß',
'class2',
],
];
}
/**
* Test for the publishUrlAliasForLocation() method.
*
* @dataProvider providerForTestPublishUrlAliasForLocationSkipsReservedWord
* @covers \eZ\Publish\Core\Persistence\Legacy\Content\UrlAlias\Handler::publishUrlAliasForLocation
* @group publish
*/
public function testPublishUrlAliasForLocationSkipsReservedWord($text, $alias)
{
$handler = $this->getHandler();
$this->insertDatabaseFixture(__DIR__ . '/_fixtures/publish_base.php');
$handler->publishUrlAliasForLocation(314, 2, $text, 'kli-KR');
$urlAlias = $handler->lookup($alias);
$this->assertEquals(314, $urlAlias->destination);
$this->assertEquals(['kli-KR'], $urlAlias->languageCodes);
}
/**
* @return int
*/

0 comments on commit 8197e67

Please sign in to comment.
You can’t perform that action at this time.