kopia lustrzana https://github.com/wagtail/wagtail
Fix subsequent slugify / title sync values for non-ascii characters
- Wagtail 5.0 regression where subsequent changes to slugify field from a sync source were not comparing against the originally set urlify'd value - Fixes #10532 - Regression caused by migration of 'slugFollowsTitle' approach not consistently comparing to the urlify version of the util on when the user focuses on the title field, broke in #10189pull/10567/head
rodzic
741c272819
commit
ccec24b888
|
|
@ -1579,7 +1579,7 @@ class TestPageEdit(WagtailTestUtils, TestCase):
|
|||
reverse("wagtailadmin_pages:edit", args=(self.child_page.id,))
|
||||
)
|
||||
|
||||
input_field_for_draft_slug = '<input type="text" name="slug" value="revised-slug-in-draft-only" data-controller="w-slug" data-action="blur->w-slug#slugify w-sync:check->w-slug#compare w-sync:apply->w-slug#urlify:prevent" data-w-slug-allow-unicode-value maxlength="255" aria-describedby="panel-child-promote-child-for_search_engines-child-slug-helptext" required id="id_slug">'
|
||||
input_field_for_draft_slug = '<input type="text" name="slug" value="revised-slug-in-draft-only" data-controller="w-slug" data-action="blur->w-slug#slugify w-sync:check->w-slug#compare w-sync:apply->w-slug#urlify:prevent" data-w-slug-compare-as-param="urlify" data-w-slug-allow-unicode-value maxlength="255" aria-describedby="panel-child-promote-child-for_search_engines-child-slug-helptext" required id="id_slug">'
|
||||
input_field_for_live_slug = '<input type="text" name="slug" value="hello-world" maxlength="255" aria-describedby="panel-child-promote-child-for_search_engines-child-slug-helptext" required id="id_slug" />'
|
||||
|
||||
# Status Link should be the live page (not revision)
|
||||
|
|
|
|||
|
|
@ -660,7 +660,7 @@ class TestSlugInput(TestCase):
|
|||
html = widget.render("test", None, attrs={"id": "test-id"})
|
||||
|
||||
self.assertInHTML(
|
||||
'<input type="text" name="test" data-controller="w-slug" data-action="blur->w-slug#slugify w-sync:check->w-slug#compare w-sync:apply->w-slug#urlify:prevent" data-w-slug-allow-unicode-value id="test-id">',
|
||||
'<input type="text" name="test" data-controller="w-slug" data-action="blur->w-slug#slugify w-sync:check->w-slug#compare w-sync:apply->w-slug#urlify:prevent" data-w-slug-allow-unicode-value data-w-slug-compare-as-param="urlify" id="test-id">',
|
||||
html,
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ class SlugInput(widgets.TextInput):
|
|||
"data-w-slug-allow-unicode-value": getattr(
|
||||
settings, "WAGTAIL_ALLOW_UNICODE_SLUGS", True
|
||||
),
|
||||
"data-w-slug-compare-as-param": "urlify",
|
||||
}
|
||||
if attrs:
|
||||
default_attrs.update(attrs)
|
||||
|
|
|
|||
Ładowanie…
Reference in New Issue