diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 026c1f7e54..c3cd3f074a 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -14,6 +14,7 @@ Changelog * Fix: Prevent exception when deleting a model with a protected One-to-one relationship (Neal Todd) * Fix: Added labels to snippet bulk edit checkboxes for screen reader users (Martey Dodoo) * Fix: Middleware responses during page preview are now properly returned to the user (Matt Westcott) + * Fix: Default text of page links in rich text uses the public page title rather than the admin display title (Andy Chosak) 2.6.1 (05.08.2019) diff --git a/docs/releases/2.7.rst b/docs/releases/2.7.rst index dae9e5e447..126ca5fb90 100644 --- a/docs/releases/2.7.rst +++ b/docs/releases/2.7.rst @@ -32,6 +32,7 @@ Bug fixes * Prevent exception when deleting a model with a protected One-to-one relationship (Neal Todd) * Added labels to snippet bulk edit checkboxes for screen reader users (Martey Dodoo) * Middleware responses during page preview are now properly returned to the user (Matt Westcott) + * Default text of page links in rich text uses the public page title rather than the admin display title (Andy Chosak) Upgrade considerations diff --git a/wagtail/admin/templates/wagtailadmin/pages/listing/_page_title_choose.html b/wagtail/admin/templates/wagtailadmin/pages/listing/_page_title_choose.html index 5104862957..06366e9753 100644 --- a/wagtail/admin/templates/wagtailadmin/pages/listing/_page_title_choose.html +++ b/wagtail/admin/templates/wagtailadmin/pages/listing/_page_title_choose.html @@ -8,7 +8,7 @@ Expects a variable 'page', the page instance.
{% if page.can_choose %} - {{ page.get_admin_display_title }} + {{ page.get_admin_display_title }} {% else %} {{ page.get_admin_display_title }} {% endif %} diff --git a/wagtail/admin/tests/test_page_chooser.py b/wagtail/admin/tests/test_page_chooser.py index f19ab651a4..b8a9583d41 100644 --- a/wagtail/admin/tests/test_page_chooser.py +++ b/wagtail/admin/tests/test_page_chooser.py @@ -208,7 +208,13 @@ class TestChooserBrowseChild(TestCase, WagtailTestUtils): self.assertEqual(response.status_code, 200) self.assertTemplateUsed(response, 'wagtailadmin/chooser/browse.html') - self.assertInHTML("foobarbaz (simple page)", response.json().get('html')) + html = response.json().get('html') + self.assertInHTML("foobarbaz (simple page)", html) + + # The data-title attribute should not use the custom admin display title, + # because JS code that uses that attribute (e.g. the rich text editor) + # should use the real page title. + self.assertIn('data-title="foobarbaz"', html) def test_parent_with_admin_display_title(self): # Add another child under child_page so it renders a chooser list