Problem/Motivation
Blocks have a region and a weight. On the block admin, you can move a block to a different region using the pulldown in the region column. If you do this, the block gets moved to the last row of the new region. BUT, the weight is unchanged. After save, the block displays in the new region based on the old weight.
Proposed resolution
Patch attached
Remaining tasks
Merge the fix
User interface changes
No changes in user interface.
API changes
No changes in API
Data model changes
No changes in Data Model
Original report by JasonSafro
Blocks have a region and a weight. On the block admin, you can move a block to a different region using the pulldown in the region column. If you do this, the block gets moved to the last row of the new region. BUT, the weight is unchanged. After save, the block displays in the new region based on the old weight.
Comment | File | Size | Author |
---|---|---|---|
#7 | patch-v3.2790245.diff | 1.58 KB | JasonSafro |
Untitled.png | 198.2 KB | JasonSafro |
Comments
Comment #2
JasonSafro CreditAttribution: JasonSafro as a volunteer commentedI think this resolved the issue. This code goes into modules/block/block.js around line 118:
Comment #3
JasonSafro CreditAttribution: JasonSafro as a volunteer commentedComment #4
JasonSafro CreditAttribution: JasonSafro as a volunteer commentedComment #5
JasonSafro CreditAttribution: JasonSafro as a volunteer commentedCleaned up the jQuery
Comment #7
JasonSafro CreditAttribution: JasonSafro as a volunteer commentedFixed whitespace issue w patch.
Comment #8
JasonSafro CreditAttribution: JasonSafro as a volunteer commentedComment #9
zombree CreditAttribution: zombree as a volunteer commentedI'm seeing this issue as well, and can confirm that the patch in #7 fixed it for me.
Comment #10
ranjeesh CreditAttribution: ranjeesh as a volunteer commentedI see this bug too.
I confirm that the patch-v3.2790245 in (#7) fixed the issue on my Drupal 7 Site running on PHP 5.6.19 and Mysql 5.5.48.
Comment #11
ranjeesh CreditAttribution: ranjeesh as a volunteer commentedComment #12
SwapS CreditAttribution: SwapS as a volunteer and at Tech Mahindra commentedHi JasonSafro,
For me , Functionality looks be working as expected.
There are two cases :
1) If weights are hidden (Which is the default behaviour)on the block configuration page. User can just pull the Block down/up to any of the region ( at any position as required ) . In this case, Block weight also gets updated based on the position of block.
2 ) If weights are visible ( by clicking on 'Show row weights' link on the right - Image attached) , User is expected to select both Region and Weight value to change the block position .
Functionality is working as expected.
Moreover, As per your patch - Block will always be put at the last position in the new region which in turn can break the functionality.(breaking its configuration feature)
I hope that Clarifies .
SwapS
Comment #13
SwapS CreditAttribution: SwapS as a volunteer and at Tech Mahindra commentedComment #14
SwapS CreditAttribution: SwapS as a volunteer and at Tech Mahindra commentedComment #15
David_Rothstein CreditAttribution: David_Rothstein as a volunteer commented@SwapS, the screenshots definitely show a bug here (which I tested and was able to reproduce just now). The block should not be in a different position after you save than it looks like it's going to be in before you save.
Anyone know if this bug affects Drupal 8 also?
Comment #16
SwapS CreditAttribution: SwapS as a volunteer and at Tech Mahindra commentedHi David,
Why will weight change when your are not changing/updating it explicitly.
In the screenshots as well, if you see weight are enabled (because of which we are able to see it as -32 in the screenshot.)
Now, When you save the configuration page - New values i.e. Region and weight (which in case of screenshot is -32 again) get saved.
This is perfect behavior i feel.
On the other side, if you drag blog to different place in that case javascript logic in block module takes care of updating weight as well.
SwapS