Skip to content

initialise slug generation when the entry type has changed and the slug is empty or temp#16816

Merged
brandonkelly merged 4 commits into4.xfrom
bugfix/initialising-slug-generator
Mar 4, 2025
Merged

initialise slug generation when the entry type has changed and the slug is empty or temp#16816
brandonkelly merged 4 commits into4.xfrom
bugfix/initialising-slug-generator

Conversation

@i-just
Copy link
Copy Markdown
Contributor

@i-just i-just commented Mar 3, 2025

Description

steps to reproduce:

  • have a section with two entry types: et1 and et2 (both have the native title field visible);
  • open the edit page for a brand new (fresh) entry, don’t fill out any content, switch to the et2 entry type, and start filling out the title; the slug doesn’t get auto-generated;

When saving a draft and the entry is fresh, and the entry type is changed, check if the slug is still empty or temporary, and if so, initialise the SlugGenerator.

Related issues

n/a

@i-just i-just requested a review from brandonkelly March 3, 2025 12:55
@brandonkelly brandonkelly merged commit 2da2603 into 4.x Mar 4, 2025
@brandonkelly brandonkelly deleted the bugfix/initialising-slug-generator branch March 4, 2025 19:49
@brandonkelly
Copy link
Copy Markdown
Member

Thanks! I moved the logic over to TitleField instead, so the JS code will get executed every time a Title field is (re-)rendered.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants