Skip to content

Commit

Permalink
fix:slug encoding
Browse files Browse the repository at this point in the history
  • Loading branch information
ah-net committed Dec 19, 2024
1 parent 2dc89d3 commit 4f632fc
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Model/Catalog/Layer/Url/Strategy/FilterSlugManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,13 @@ public function createFilterSlugByAttributeOptions(array $options)

$attributeSlugEntity = $this->attributeSlugFactory->create();
$attributeSlugEntity->setAttribute($option->getLabel());
$attributeSlugEntity->setSlug($this->translitUrl->filter($option->getLabel()));

$slug = $this->translitUrl->filter($option->getLabel());
if (empty($slug)) {
$slug = urlencode($option->getLabel());
}

$attributeSlugEntity->setSlug($slug);

$this->attributeSlugRepository->save($attributeSlugEntity);
$this->cache->remove(self::CACHE_KEY);
Expand Down

0 comments on commit 4f632fc

Please sign in to comment.