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.

CommentFileSizeAuthor
update-own-weight.patch1002 bytesdemma10

Comments

Demma10 created an issue. See original summary.

  • andy_w committed f05d2b0 on 1.0.x authored by Demma10
    Issue #3204448 by Demma10: Cannot change weight of existing nodes
    
andy_w’s picture

Status: Active » Fixed

Thanks for this fix :)

andy_w’s picture

Status: Fixed » Closed (fixed)