Fix GenericPageBreadcrumbsMixin to correctly take the specified number of items

The old code was taking the N-th item from the view's generic breadcrumbs instead of taking the last N items as the comment suggests
pull/12314/head
Sage Abdullah 2024-08-27 16:56:46 +01:00 zatwierdzone przez Matt Westcott
rodzic 98bbded2a8
commit 05230388d8
1 zmienionych plików z 4 dodań i 3 usunięć
wagtail/admin/views/pages

Wyświetl plik

@ -66,6 +66,7 @@ class GenericPageBreadcrumbsMixin:
# which in most cases is the final item that links to the current view.
# However, this can be customised in the case of generic views that are
# nested inside another generic view.
return self.breadcrumbs_items + [
super().get_breadcrumbs_items()[-self.breadcrumbs_items_to_take]
]
return (
self.breadcrumbs_items
+ super().get_breadcrumbs_items()[-self.breadcrumbs_items_to_take :]
)