Closed (fixed)
Project:
Drupal core
Version:
7.x-dev
Component:
dashboard.module
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
9 Oct 2010 at 07:53 UTC
Updated:
24 Oct 2010 at 20:20 UTC
Jump to comment: Most recent file
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 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 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 commentedLooks perfect.
Comment #6
dries commentedCommitted to CVS HEAD. Thanks.