diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 00693230b9..4bbbd9aeec 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -9,6 +9,7 @@ Changelog * Fix: Status button on 'edit page' now links to the correct URL when live and draft slug differ (LB (Ben Johnston)) * Fix: Image title text in the gallery and in the chooser now wraps for long filenames (LB (Ben Johnston), Luiz Boaretto) * Fix: Move image editor action buttons to the bottom of the form on mobile (Julian Gallo) + * Fix: StreamField icons are now correctly sorted into groups on the 'append' menu (Tim Heap) 2.0 (xx.xx.xxxx) - IN DEVELOPMENT diff --git a/docs/releases/2.1.rst b/docs/releases/2.1.rst index a9cfa61c39..4936c5cf72 100644 --- a/docs/releases/2.1.rst +++ b/docs/releases/2.1.rst @@ -22,7 +22,8 @@ Bug fixes * Status button on 'edit page' now links to the correct URL when live and draft slug differ (LB (Ben Johnston)) * Image title text in the gallery and in the chooser now wraps for long filenames (LB (Ben Johnston), Luiz Boaretto) - * Fix: Move image editor action buttons to the bottom of the form on mobile (Julian Gallo) + * Move image editor action buttons to the bottom of the form on mobile (Julian Gallo) + * StreamField icons are now correctly sorted into groups on the 'append' menu (Tim Heap) Upgrade considerations ====================== diff --git a/wagtail/core/blocks/stream_block.py b/wagtail/core/blocks/stream_block.py index 5618646499..12838f9bb9 100644 --- a/wagtail/core/blocks/stream_block.py +++ b/wagtail/core/blocks/stream_block.py @@ -56,6 +56,11 @@ class BaseStreamBlock(Block): """ return StreamValue(self, self.meta.default) + def sorted_child_blocks(self): + """Child blocks, sorted in to their groups.""" + return sorted(self.child_blocks.values(), + key=lambda child_block: child_block.meta.group) + def render_list_member(self, block_type_name, value, prefix, index, errors=None, id=None): """ Render the HTML for a single list item. This consists of an