initial block order not saved

mariuss - February 9, 2008 - 23:15
Project:Drupal
Version:6.x-dev
Component:block.module
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active
Description

When you add a new block to a region, by selecting the region name while the block is in the Disabled group, the block gets moved to the top of the list of blocks in that region. The block is flagged, as expected, with a yellow marker (telling you that you need to save).

Now click "Save blocks". When the page reloads the block now is at the end of the list of blocks in its region.

You can drag the block to the top and save again, it will stick after this.

#1

ScoutBaker - February 10, 2008 - 04:54

This is due to the block weights. If you have javascript disabled, you'll see the weight column just like in D5. I believe that the actual "bug" in this case is displaying the block at the top of the region when you first select the region.

When you set the region to display a block in using the drop-down, the weight of the block is not changed when it is moved to that region. After clicking save, the blocks for a given region are, properly, displayed in weighted order. When you use the drag-and-drop functionality to drag a block to another region, the weights are recalculated automatically in the background to display in the proper order.

#2

lyricnz - November 22, 2009 - 12:44
Version:6.0-rc4» 6.x-dev

This still happens in Drupal 6. It seems like there are two possible solutions: either update the weight of the newly enabled item, so that it genuinely belongs at the top of the region, or put it into the right place based on its current weight.

The first of those seems like the most reasonable, and should be able to use the existing row-drop code from tabledrag.

 
 

Drupal is a registered trademark of Dries Buytaert.