API page: https://api.drupal.org/api/drupal/modules%21block%21block.module/functio...
block_load() looks like you can use it to load a block.
However, the query it runs doesn't filter on the theme at all, and returns the first block found.
If you have more than 1 theme on the site (eg main theme and admin theme), then each combination of module + delta is repeated for each theme.
So this means that you don't know for sure which block record you're going to get.
The documentation should state that this function does NOT get you a block record for a specific block, so its return value should not be used for anything that is theme-specific, such as the region or page visibility.
Comments
Comment #1
jhodgdonAgreed. Should be a decent novice project, if anyone is still working on D7 documentation.
Comment #2
vbouchetComment #3
jhodgdonThanks for the patch! Pretty good... but the sentence in the patch is a "comma splice". Can you add the word "so" after the comma, to make it better English? Also take out the word "a" before "theme-specific".
Comment #4
vbouchetWait! I can't imagine my English not being perfect :D
Please find the updated patch and an interdiff.
Comment #5
joachim commentedLooks good. Thanks for the patch!
Comment #6
jhodgdonThanks! Imperfect English is one reason we have patch reviews. And even native speakers sometimes write imperfectly. ;) (I personally am glad we don't have to write docs in French -- oh the pain of all those spelling rules! :) )
Comment #7
David_Rothstein commentedCommitted to 7.x - thanks!
I stuck the word "the" in there on commit (before "module and delta parameters") since it seemed to be missing.