The book module doesn't respect page weights for the "Next" and "Prev" links when using 2 level deep structure. It sorts the alphabetically only.

CommentFileSizeAuthor
#2 book.module_weight_patch1.62 KBpuregin

Comments

puregin’s picture

Assigned: Unassigned » puregin

Confirmed, with the following book contents:

* My Book
This is the root node of my book.
* Shrubs
Section 1, weight 0
* Yew hedges
Subsection 1.1, weight 0
* Cedar hedges
Subsection 1.2, weight 1
* Buildings
Section two, weight 1
* Three storey apartment blocks
Subsection 2.1, weight 0
* Duplexes
Subsection 2.2, weight 1
* Automobiles
Third section, weight 2
* Sub-compact
Subsection 3.1, weight 0
* Minivan
Subsection 3.2, weight 1
* Commuter car
Subsection 3.3, weight 2

puregin’s picture

StatusFileSize
new1.62 KB

The attached patch to book.module ensures that a book node's weight is captured when the book node lists returned by book_location() and book_location_down() are generated. This information is required when selecting previous/next page candidates in book_next() and book_prev().

Note that book_location_down() was missing an explicit field b.weight in the SQL SELECT statement, but this value would usually be supplied implicitly because it is used to ORDER the result.

dries’s picture

Committed to DRUPAL-4-5 and HEAD. I think it is only necessary for book_next(), not for book_prev() though.

Anonymous’s picture