-
-
Notifications
You must be signed in to change notification settings - Fork 21
Closed
Description
Addon
No specific addon β This bug report is related to Webtools Core
Describe the bug
When enabling Draft & Publish on a collection that uses Webtools URL aliases, the plugin throws an SQL error during bulk URL generation or alias reordering.
The error only appears after activating Draft & Publish, because Strapi duplicates entries with the same document_id (draft + published versions).
Error Log:
error: UPDATE `tests_url_alias_lnk` as a, (
select `id`, row_number() over (partition by `test_id` order by `url_alias_ord`) as src_order
from `tests_url_alias_lnk`
where `test_id` = 25
) AS b
SET `url_alias_ord` = b.src_order
WHERE b.id = a.id
Record has changed since last read in table 'tests_url_alias_lnk'
Database Before Enabling Draft & Publish
tests
id | document_id | title | slug | published_at
22 | f6y... | Test 1 | test-1 | 2025-10-09
23 | sz5... | Test 2 | test-2 | 2025-10-09
tests_url_alias_lnk
id | test_id | url_alias_id | url_alias_ord
170 | 22 | 94 | 1
172 | 23 | 95 | 1
After Enabling Draft & Publish
tests
id | document_id | title | slug | published_at
22 | f6y... | Test 1 | test-1 | 2025-10-09
24 | f6y... | Test 1 | test-1 | NULL
23 | sz5... | Test 2 | test-2 | 2025-10-09
25 | sz5... | Test 2 | test-2 | NULL
tests_url_alias_lnk
id | test_id | url_alias_id | url_alias_ord
170 | 22 | 94 | 1
172 | 23 | 95 | 1
174 | 24 | 94 | 1
175 | 25 | 95 | 1
Steps to reproduce the behavior
- Create a new collection type (e.g. test) with fields:
title (text)
slug (UID, from title)
parent_page (relation)
- Configure Webtools URL pattern: [parent_page.slug]/[slug]
- Create two records
- Run Bulk Generate β works fine.
- Enable Draft & Publish on the same collection.
- Run Bulk Generate again β error appears.
Expected behavior
The plugin should either ignore draft entries when generating aliases, or correctly handle multiple records with the same document_id.
Screenshots
No response
Code snippets
Node.js version
v20.19.5
Package manager
NPM
Strapi version
5.27.0
Plugin version
1.7.0
Database
MariaDB
Operating system
Mac OS 14.3
Additional context
No response
JensUweB
Metadata
Metadata
Assignees
Labels
No labels