I'm attaching a simple patch that increases the block weight range ("delta") from -10/+10 to -100/+100.
This is necessary to keep nodeasblock blocks from "falling out of place" and appearing lower or higher in a region after a user edits the node.
The "falling out of place" happens because Drupal's block admin panel might assign weights outside the -10/+10 range to nodeasblock blocks -- e.g., a block might get assigned a weight of -57. Yet, when the block is edited, the nodeasblock module will rest the block weight to its maximum of -10.
The patch sets the delta to -100/+100, which has been sufficient to handle sites with LOTS of blocks in my case. Of course, an ideal situation would be to have the nodeasblock module calculate the maximum block range based on the blocks that already exist, but that might not be easy to do nor smart for performance.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | nodeasblock-block_weight_is_out_of_range-640854-3.patch | 1.15 KB | osman |
| #2 | nodeasblock-delta.patch | 800 bytes | andrechun |
| nodeasblock-delta.patch | 483 bytes | aasarava |
Comments
Comment #1
superstar commentedThis is definitely needed!
Can you please re-roll the patch to include the same delta entry for thenodeasblock_default_weight within nodeasblock_form_node_type_form_alter?
Thanks
Comment #2
andrechun commentedComment #3
osmanre-rolling the patch against 6.x-1.x-dev (February 24, 2011)