<p>Every entry needs a unique URI - otherwise, Craft wouldn't know which entry to load for a URL if multiple entries have the same one. A slug is <em>usually</em> used as part of the URL, but not always. If it is, Craft tries to add an incrementing number suffix to the end of the slug to generate a unique URL (up to the <a href="https://craftcms.com/docs/4.x/config/general.html#maxslugincrement" rel="nofollow noreferrer"><code>maxSlugIncrement</code> config</a>).</p>
<p>In your case, the slug is <em>not</em> used in the URL format. You have <code>produkte/{kubProductIsbnField}</code> as your URI setting, so Craft will use <code>kubProductIsbnField</code> as the second path segment, not the slug. That's why it doesn't try to increment the slug - it won't change the URL in this case. You probably have another entry in your section with the same ISBN, so the URL <code>produkte/123-3-12-123451-7</code> is already taken.</p>
<p>If you don't use the slug, you have to ensure your URI setting will always produce a unique URL. In your use-case, is there a legitimate reason to have two entries with the same ISBN in your section? If there isn't, this warning might even be helpful, by informing you that you're creating a duplicate entry.</p>
<p>If you need multiple entries with the same ISBN, you need to adjust your URI settings, so that entries get unique URLs each. For example, you can put a truncated part of the description text in the URL.</p>
<p>Another option would be to set your title format to be based on <code>kubProductIsbnField</code>, which means the title - and therefore also the slug - will match the ISBN by default. Then use <code>produkte/{slug}</code> as the URI setting. This will result in the same URL as before, but will allow Craft to add an incrementing suffix to the slug to generate unique URLs for entries with the same ISBN.</p>

CC BY-SA 4.0
2024-02-13T07:27:37.593Z
I will look into make the isbn field also my title to use `produkte/{slug}`.


Also we do NOT want duplicated entries by the isbn. But craft does not throw an error on the first creation of the entry. Just tells the user it is saved, but not that it is deactivated because of this issue. So some of our users think its saved and later notice that it is not. Only on saving a second time will craft currently show the error
Leonardo
CC BY-SA 4.0
2024-02-03T14:11:19.817Z
2024-02-03T14:11:19.817Z
MoritzLost
<p>We have a section of products. Their title is always the raw ISBN Number. I think this makes it hard for craft to auto increment them.</p>
<p>Example:</p>
<p><a href="https://i.sstatic.net/Cf7BG.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/Cf7BG.png" alt="enter image description here" /></a></p>
<p>But this is not the main problem.</p>
<p>Since some update, Craft no longer gives an error on the initial safe of a new entry if the slug can't be generated. (it is for example already taken, but can't be incremented)</p>
<p>So Craft &quot;saves&quot; the entry, but throws the user back to the entry table view and disables the entry. The user only notices this if they pay attention.</p>

CC BY-SA 4.0
2024-02-01T09:23:35.023Z
What's the URL setting for the products section?
MoritzLost
CC BY-SA 4.0
2024-02-02T07:42:47.763Z
@MoritzLost `produkte/{kubProductIsbnField}`
Leonardo
<craft4><slug><saveentry>
Could not generate a unique URI based on the URI format
# Could not generate a unique URI based on the URI format

(Asked by: username_0 on 2024-02-01)

We have a section of products. Their title is always the raw ISBN Number. I think this makes it hard for craft to auto increment them.

Example:

[![enter image description here](https://i.sstatic.net/Cf7BG.png)](https://i.sstatic.net/Cf7BG.png)

But this is not the main problem.

Since some update, Craft no longer gives an error on the initial safe of a new entry if the slug can't be generated. (it is for example already taken, but can't be incremented)

So Craft "saves" the entry, but throws the user back to the entry table view and disables the entry. The user only notices this if they pay attention.

**Tags:** craft4, slug, saveentry

> **Comments:**
> **username_1**: What's the URL setting for the products section?  
> **username_0**: @username_1 `produkte/{kubProductIsbnField}`  

---

## 1 answers

### Answer by username_1 on 2024-02-03. Score: 1

Every entry needs a unique URI - otherwise, Craft wouldn't know which entry to load for a URL if multiple entries have the same one. A slug is *usually* used as part of the URL, but not always. If it is, Craft tries to add an incrementing number suffix to the end of the slug to generate a unique URL (up to the [`maxSlugIncrement` config](https://craftcms.com/docs/4.x/config/general.html#maxslugincrement)).

In your case, the slug is *not* used in the URL format. You have `produkte/{kubProductIsbnField}` as your URI setting, so Craft will use `kubProductIsbnField` as the second path segment, not the slug. That's why it doesn't try to increment the slug - it won't change the URL in this case. You probably have another entry in your section with the same ISBN, so the URL `produkte/123-3-12-123451-7` is already taken.

If you don't use the slug, you have to ensure your URI setting will always produce a unique URL. In your use-case, is there a legitimate reason to have two entries with the same ISBN in your section? If there isn't, this warning might even be helpful, by informing you that you're creating a duplicate entry.

If you need multiple entries with the same ISBN, you need to adjust your URI settings, so that entries get unique URLs each. For example, you can put a truncated part of the description text in the URL.

Another option would be to set your title format to be based on `kubProductIsbnField`, which means the title - and therefore also the slug - will match the ISBN by default. Then use `produkte/{slug}` as the URI setting. This will result in the same URL as before, but will allow Craft to add an incrementing suffix to the slug to generate unique URLs for entries with the same ISBN.

> **Comments:**
> **username_0**: I will look into make the isbn field also my title to use `produkte/{slug}`.   Also we do NOT want duplicated entries by the isbn. But craft does not throw an error on the first creation of the entry. Just tells the user it is saved, but not that it is deactivated because of this issue. So some of our users think its saved and later notice that it is not. Only on saving a second time will craft currently show the error  

---

