Skip to content

Commit

Permalink
Use StringHelper::slugify before setting $entry->slug. Fix #15.
Browse files Browse the repository at this point in the history
internetztube committed Nov 27, 2021
1 parent b4f30ad commit f1204b1
Showing 3 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Slug Equals Title Changelog
All notable changes to this project will be documented in this file.

## 1.3.4 - 2021-11-28
### Fixed
- Use `StringHelper::slugify` before setting `$entry->slug`. Fix #15.

## 1.3.3 - 2021-10-17
### Updated
- Updated Icon.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@
"name": "internetztube/craft-slug-equals-title",
"description": "This plugin makes sure that the slug is always the same as the title.",
"type": "craft-plugin",
"version": "1.3.3",
"version": "1.3.4",
"keywords": [
"craft",
"cms",
1 change: 1 addition & 0 deletions src/SlugEqualsTitle.php
Original file line number Diff line number Diff line change
@@ -45,6 +45,7 @@ public function init()
if (Craft::$app->getConfig()->getGeneral()->limitAutoSlugsToAscii) {
$slug = StringHelper::toAscii($slug, $element->site->language);
}
$slug = StringHelper::slugify($slug, '-', $element->site->language);

$element->slug = $slug;
};

0 comments on commit f1204b1

Please sign in to comment.