Closed (fixed)
Project:
Drupal core
Version:
9.1.x-dev
Component:
documentation
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
2 May 2016 at 19:24 UTC
Updated:
27 Jan 2021 at 12:59 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
jhodgdonWell, that's very interesting. I see two implementations in core -- one in a test, and one in statistics.module. But I don't see where this hook is invoked. Any ideas?
Comment #3
jhodgdonComment #4
progga commentedAccording to Berdir's StackOverflow answer, it is called in \Drupal\Core\Block\BlockManager
Comment #7
andypostWhat is a proper place to put this hooks?
Example of usage
Comment #8
andypostI think for blocks it makes sense to have separate *.api.php like menu has
core/lib/Drupal/Core/Menu/menu.api.phpComment #12
msankhala commentedHere is the patch.
Comment #13
andypostDefinitions should be typed, I bet it kinda
\Drupal\Component\Plugin\Definition\PluginDefinitionInterface[]|array[]as\Drupal\Core\Plugin\FilteredPluginManagerInterface::getFilteredDefinitions()returnsComment #14
msankhala commented@ashrafabed Now @param line length is going more than 80 characters. Is it allowed to go more than 80 characters if we specify FQN of the types of param?
Comment #18
tanubansal commentedTested #14, hook_block_alter code has been added
Comment #20
abhijith s commentedApplied patch #14 and it works . The hook_block_alter is correctly documented in the patch
Comment #21
abhijith s commentedComment #22
alexpottWe know that blocks are not going to be
\Drupal\Component\Plugin\Definition\PluginDefinitionInterface[]so onlyarray[]is needed here.Comment #23
manish-31 commented@alexpott removed PluginDefinitionInterface[], needs review.
Comment #24
sulfikar_s commentedHello,
As the patch in #23 failed to apply and found to be not a proper patch. I've created a new patch addressing the comment #22.
Please review.
Comment #25
vishalghyv commentedPatch looks good to me.
Comment #28
catchCommitted/pushed to 9.2.x and cherry-picked to 9.1.x, thanks!