Book Navigation Block does not sort Books by weight

Created on 18 November 2016, over 7 years ago
Updated 26 April 2024, 2 months ago

Problem/Motivation

The Book Navigation Block does not sort the list of books by weight.

A weight can be assigned to the first page of a book through the outline tab, however it has no effect.

I've created a patch and will submit it shortly. It's my first patch!

NB: this concerns the order of multiple books, NOT ordering pages within a book.

Steps to Reproduce:

  • Enable the book module (it's in core)
  • Create two books:
  • Add content > Book page >
    • Title: 'My first book'
    • Expand 'Book outline' settings - choose 'Create a new book'
    • Then do the same for 'My second book'
  • Structure > Block layout > Add a Book navigation block in the sidebar
    (Use the default settings.)
  • Observe that it shows 'My first book' then 'My second book'
  • Click the second book, Outline tab, change the weight to negative (so it should appear above book 1 in the list)
  • Observe list is still in the same (wrong) order.
  • Apply patch, refresh, order should have changed.

Proposed resolution

Simple sort of books using sortByWeightElement.

Remaining tasks

- Write tests.

User interface changes

None.

API changes

None.

Data model changes

None.

πŸ› Bug report
Status

Needs work

Version

1.0

Component
BookΒ  β†’

Last updated 1 day ago

  • Maintained by
  • πŸ‡ΊπŸ‡ΈUnited States @pwolanin
Created by

πŸ‡ΊπŸ‡ΈUnited States mtnguru

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024