Problem/Motivation
When trying to reorder an existing page of a book using the book link weight widget the page's new position doesn't stick, instead the page retains its original weight. Reordering other sibling pages from that page's node edit form works.
New pages of the book do not have this issue.
Steps to reproduce
- Create a book node with some child pages
- Go to one of the child pages and click the Edit tab
- Use the drag and drop handle to move the page being edited. Do not move any other pages
- Click the save button
Expected:
The node appears in its new position in the book outline.
Actual:
The node appears at its old position in the book outline.
Proposed resolution
This appears to be caused by this module's submit handler only updating the hidden [book][weight] form element for new nodes and not for existing nodes. Since this module's submit handler runs before the default book form submit handler the new weights get overridden by the default book submit handler.
The attached patch updates the submit handler to also update the [book][weight] form element for the current node being edited.
| Comment | File | Size | Author |
|---|---|---|---|
| update-own-weight.patch | 1002 bytes | demma10 |
Comments
Comment #3
andy_w commentedThanks for this fix :)
Comment #4
andy_w commented