See the attached screenshot. To reproduce, go to admin/structure/block/list/seven and click the "Add block" link from there.
It's due to this code in block_help(), combined with the patch that went in at #556872: Action links do not work on all levels (example: 'add block' action link does not appear):
if ($arg[0] == 'admin' && $arg[1] == 'structure' && $arg['2'] == 'block' && (empty($arg[3]) || $arg[3] == 'list')) {
// (The help text intended for admin/structure/block and admin/structure/block/list/[theme-name] is output here.)
}
Ideally, we'd much rather replace this ugly code with something like the following:
case 'admin/structure/block':
case 'admin/structure/block/list/%':
But that won't work as is since the block module's menu items aren't being created via menu wildcards but rather via a custom foreach() loop. (Would love to see that part fixed somehow...)
Comments
Comment #1
David_Rothstein commentedScreenshot didn't get attached for some reason.
Comment #2
David_Rothstein commentedAssuming we don't want to try for a nicer fix, something horrible like the attached should get the job done.
Comment #3
andypost+1 to rtbc
is help needed for block add and not for edit? Maybe we unify this
Comment #4
retester2010 commented#2: fix-add-block-help-743590-2.patch queued for re-testing.
Comment #6
andypostre-roll against current HEAD, added test, taggin' and suppose RTBC
Issue reproduced only when more then 1 theme enabled and "Add block" link clicked on none-default theme.
Comment #7
reglogge commentedThis works.
Reroll against current HEAD and fixing indentation issue here:
Comment #8
David_Rothstein commentedThe tests don't look quite right to me because they assert the presence of a translated *partial* string (not the whole string that actually appears in the module). This translation won't actually exist. Does that mean the tests could fail when run on a non-English site? (I'm not sure.)
I wonder if we need tests at all here? I guess it doesn't hurt, but this is the sort of thing that is hard to test cleanly, and since we don't reorganize URLs that often (certainly not likely to happen again in the Drupal 7 cycle) it's also not the sort of thing that can break easily. I bet we could just rely on humans to catch this kind of thing.
Comment #9
thedavidmeister commentedI *think* this is not an issue in d8 due to the routing system doing stuff, *but* if we're doing tests (which should work fine, the testbots should run in English unless part of the test changes the language, I believe) then the tests will need to happen in d8 and then the fix ported to d7.
Comment #18
quietone commentedTested on 8.9.x and 9.2.x and this is not a problem when adding a custom block or placing one.
So moving to Drupal 7.