Inconsistent weight range between "Manage Order" screen and Node weight field

Created on 26 June 2025, 8 days ago

Problem/Motivation

There is a mismatch in the weight range allowed between the Manage Order screen and the Node weight field on the node edit form.

When an admin reorders nodes using the Manage Order screen (/admin/structure/types/manage/[content-type]/weight), the system assigns weights in the range –100 to 100 by default. These weight values are stored in the node_weight field.

However, in the node edit form, the node_weight field only allows a range of –10 to 10 (as defined in the default configuration). If a node has a weight outside this range (e.g., –100), the user is either forced to change it or is prevented from saving the node, depending on the widget used.

This causes confusion and can result in unexpected reordering behavior.

Steps to reproduce

  1. Create 10 nodes of a content type (e.g., Basic Page).
  2. Enable the Node Weight field for that content type.
  3. Go to:
  4. Structure → Content types → Basic Page → Manage order
  5. Reorder the nodes randomly and click Save changes.

Problem 1: Using the "Weight selector" widget
(Widget configured under Manage form display)

  1. Edit the first node (based on the new order set above).
  2. The weight field shows –10, even though the actual stored value might be –100.
  3. Save the node.
  4. Go back to the Manage order screen — the node may have dropped to a different position (because the weight changed to –10).

Problem 2: Using the "Number" widget

  1. Edit the first node.
  2. The field displays the correct value (e.g., –100).
  3. Try to save the node.
  4. You'll get a validation error because the default allowed range is –10 to 10.

Proposed resolution

Update the default weight range in the node_weight.settings.yml configuration file:

min_weight: -100
max_weight: 100

Alternatively, provide a UI under the module configuration screen to allow admins to set custom min/max values for the node weight field.

🐛 Bug report
Status

Active

Version

3.0

Component

Code

Created by

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024