diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 848ccbe978..efd78632ce 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -41,6 +41,7 @@ Changelog * Fix: Prevent new block IDs from being assigned on repeated calls to `StreamBlock.get_prep_value` (Colin Klein) * Fix: Prevent broken images in notification emails when static files are hosted on a remote domain (Eduard Luca) * Fix: Replace styleguide example avatar with default image to avoid issues when custom user model is used (Matt Westcott) + * Fix: `DraftailRichTextArea` is no longer treated as a hidden field by Django's form logic (Sergey Fedoseev) 2.6.2 (19.09.2019) diff --git a/docs/releases/2.7.rst b/docs/releases/2.7.rst index d4ac1d0468..9bf80d3e65 100644 --- a/docs/releases/2.7.rst +++ b/docs/releases/2.7.rst @@ -65,6 +65,7 @@ Bug fixes * Prevent new block IDs from being assigned on repeated calls to ``StreamBlock.get_prep_value`` (Colin Klein) * Prevent broken images in notification emails when static files are hosted on a remote domain (Eduard Luca) * Replace styleguide example avatar with default image to avoid issues when custom user model is used (Matt Westcott) + * ``DraftailRichTextArea`` is no longer treated as a hidden field by Django's form logic (Sergey Fedoseev) Upgrade considerations diff --git a/wagtail/admin/rich_text/editors/draftail/__init__.py b/wagtail/admin/rich_text/editors/draftail/__init__.py index 851bfd5b3a..6398b0cca2 100644 --- a/wagtail/admin/rich_text/editors/draftail/__init__.py +++ b/wagtail/admin/rich_text/editors/draftail/__init__.py @@ -9,6 +9,7 @@ from wagtail.core.rich_text import features as feature_registry class DraftailRichTextArea(widgets.HiddenInput): template_name = 'wagtailadmin/widgets/draftail_rich_text_area.html' + is_hidden = False # this class's constructor accepts a 'features' kwarg accepts_features = True diff --git a/wagtail/admin/tests/test_rich_text.py b/wagtail/admin/tests/test_rich_text.py index c1a6a1f53e..635aa931a0 100644 --- a/wagtail/admin/tests/test_rich_text.py +++ b/wagtail/admin/tests/test_rich_text.py @@ -1,6 +1,6 @@ from bs4 import BeautifulSoup from django.conf import settings -from django.test import TestCase +from django.test import SimpleTestCase, TestCase from django.test.utils import override_settings from django.urls import reverse @@ -742,3 +742,17 @@ class TestPageLinkHandler(TestCase): result, '' % events_page_id ) + + +class TestWidgetNotHidden(SimpleTestCase): + def test_draftail(self): + self.assertIs( + DraftailRichTextArea().is_hidden, + False, + ) + + def test_hallo(self): + self.assertIs( + HalloRichTextArea().is_hidden, + False, + )