Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
At admin/structure/dashboard there is an empty block at the foot of the list, which can't be moved.
Comment | File | Size | Author |
---|---|---|---|
#4 | 936582-4.drupal.dashboard-blocks-blank-block.patch | 821 bytes | joachim |
#1 | d7.936582.patch | 688 bytes | Haza |
Comments
Comment #1
Hazahummm
block.admin.inc, we add system_main key
Not sure what is this system_main blocks, any clues ?
btw, if we check if the key is present before trying to force the requiered = TRUE, it could resolve the issue. But i'am really not sure about that.
Comment #2
David_Rothstein CreditAttribution: David_Rothstein commentedThis is fallout from #140783: A select list without #default_value always passes form validation (and the cleanup patch there at http://drupal.org/node/140783#comment-3501422 fixed this plus several other things) - however, that issue turned into a long mess and it will take time to sort it all out; it seems very reasonable to fix this one separately :)
'system_main' is the main content block, which is usually present on the form when the Block module uses it, but not when the Dashboard module reuses it, so indeed, checking isset() is a reasonable fix.
I'd probably suggest checking
isset($form['blocks']['system_main']['region'])
as the patch at the above issue did, though - might as well go all the way and check as deep in the array as we want to go.Also, it's minor, but:
Please don't remove the blank line at the end. It's needed to logically separate this block of code from what comes after it.
With those changes I'd say this is RTBC - thanks!
Comment #4
joachim CreditAttribution: joachim commentedThat'll be the git patches not applying ;)
Here's a reroll with the changes suggested in #2.
I've changed the comment too, as otherwise I think someone reading this function in block module could legitimately wonder why on earth we need to test the block is there first. Maybe worth even explicitly saying 'because dashboard module generates this form without it', but I can't think of a concise way to say that....
Comment #5
David_Rothstein CreditAttribution: David_Rothstein commentedLooks perfect.
Comment #6
Dries CreditAttribution: Dries commentedCommitted to CVS HEAD. Thanks.