# UniqueSlugs Addon - bugfix and new localized slugs

**URL:** <https://discourse.getcockpit.com/t/uniqueslugs-addon-bugfix-and-new-localized-slugs/766>\
**Category:** Addons\
**Created:** [April 24, 2019, 11:44am UTC](https://discourse.getcockpit.com/t/uniqueslugs-addon-bugfix-and-new-localized-slugs/766 "2019-04-24T11:44:12Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![raffaelj](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.getcockpit.com/raffaelj/32/331_2.png) [@raffaelj](https://discourse.getcockpit.com/u/raffaelj)\
**Post date:** [April 24, 2019, 11:44am UTC](https://discourse.getcockpit.com/t/uniqueslugs-addon-bugfix-and-new-localized-slugs/766/1 "2019-04-24T11:44:12Z")

</div>

I realized, that the UniqueSlugs addon never really worked, if more than one duplicates existed. Stupid mistake…

```php
$entries = $app->module('collections')->count($name, [$slugName => $slug]);

```

The code above never counted the auto-generated slugs with numeric suffixes.

If you use this addon, you should update to the latest version, that now has support for localized slugs, too.

> **[raffaelj/cockpit\_UniqueSlugs](https://github.com/raffaelj/cockpit_UniqueSlugs/)**
>
> addon for Cockpit CMS to create unique slugs. Contribute to raffaelj/cockpit\_UniqueSlugs development by creating an account on GitHub.

See this discussion for some more background [#1086](https://github.com/agentejo/cockpit/issues/1086) and/or check the readme.

---

<div class="post-metadata">

**Author:** ![raffaelj](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.getcockpit.com/raffaelj/32/331_2.png) [@raffaelj](https://discourse.getcockpit.com/u/raffaelj)\
**Post date:** [September 8, 2019, 10:09pm UTC](https://discourse.getcockpit.com/t/uniqueslugs-addon-bugfix-and-new-localized-slugs/766/2 "2019-09-08T22:09:57Z")

</div>

Today I found and fixed another important bug. If you update only partial data of an entry via api or via custom php script, the slug can be overwritten to the default placeholder. If you use the admin interface, everthing works fine.

- [issue details](https://github.com/raffaelj/cockpit_UniqueSlugs/issues/3)
- [fix](https://github.com/raffaelj/cockpit_UniqueSlugs/commit/d79c827e2e1d670960ec09139b81c669381835bc)
- [latest release 0.5.2](https://github.com/raffaelj/cockpit_UniqueSlugs/releases/tag/0.5.2)

---

<div class="post-metadata">

**Author:** ![Boerul](https://avatars.discourse-cdn.com/v4/letter/b/b5ac83/32.png) [@Boerul](https://discourse.getcockpit.com/u/Boerul)\
**Post date:** [April 12, 2023, 6:48am UTC](https://discourse.getcockpit.com/t/uniqueslugs-addon-bugfix-and-new-localized-slugs/766/3 "2023-04-12T06:48:56Z")

</div>

Hello,  
Is it possible to remove diacritics when generating slug? Or even better substitute them like this:  
ș to s  
ț to t  
ă to a  
â to a  
î to i  
And ofcourse te uppercase versions of the diacritics…

Thank you

---

<div class="post-metadata">

**Author:** ![raffaelj](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.getcockpit.com/raffaelj/32/331_2.png) [@raffaelj](https://discourse.getcockpit.com/u/raffaelj)\
**Post date:** [April 12, 2023, 7:44am UTC](https://discourse.getcockpit.com/t/uniqueslugs-addon-bugfix-and-new-localized-slugs/766/4 "2023-04-12T07:44:23Z")

</div>

Yes. The addon uses this sluggify function:

> <https://github.com/agentejo/cockpit/blob/next/lib/LimeExtra/Helper/Utils.php#L119>

Be aware, that this addon is not compatible with Cockpit CMS v2,
