Closed (duplicate)
Project:
Drupal core
Version:
8.0.x-dev
Component:
block.module
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
1 Jun 2007 at 12:19 UTC
Updated:
8 Jul 2015 at 06:34 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
profix898 commentedComment #2
profix898 commentedNobody? Its a simple patch that doesn't hurt IMO.
Comment #3
spyderpie commentedi would test ... but it says version 6.x ... I'm at 5.1 ... can I put it there?
Julie
Comment #4
profix898 commented@spyderpie: The patch is for the development version (6.x) of Drupal and there is not much to test here. The patch doesnt provide any new functionality, it only rearranges the some small pieces of code in block.module. To test the patch you should install a development snapshot and play with the block administration. If you dont experience any difference with/without the patch then it is ready ...
Comment #5
profix898 commented... still needs review ...
Comment #6
spyderpie commentedOkay - give me about 2 days and I will test .... just got a lot going on .. (and two munchkins stealing my computer time! LOL)
Comment #7
profix898 commentedRerolled for latest HEAD.
Comment #8
profix898 commented... still applies ...
Comment #9
pwolanin commentedWithout something like this, it doesn't seem possible for a module to remove a block it has previously declared via an API function - rather one would have to delete items from the {blocks} and {blocks_roles} tables, which seems a bit ugly. This is kind of blocking this issue: http://drupal.org/node/156626
Comment #10
profix898 commented@pwolanin: It seems you decided to delete blocks from the tables directly. I think a reusable block_rehash() would be useful in several locations and it is needed for being able to extend blocks administration in contributed modules. Otherwise we'd have to duplicate the whole function. Any chance to have this RTBC?
Comment #11
pwolanin commentedI'll look in more detail. Seems the original code neglects to delete form {block_roles} if a block goes away?
Comment #12
bdragon commentedFile to patch: modules/block/block.module
patching file modules/block/block.module
Hunk #1 succeeded at 210 (offset 57 lines).
Hunk #2 succeeded at 197 (offset 2 lines).
Hunk #3 FAILED at 205.
Hunk #4 FAILED at 231.
Hunk #5 FAILED at 254.
Hunk #6 FAILED at 514.
4 out of 6 hunks FAILED -- saving rejects to file modules/block/block.module.rej
Needs rerolled (Pre-split era?) and also needs to be rolled from the correct directory.
Comment #13
chx commentedI disagree this being a bug and especially disagree it being critical. Critical means a part of core is totally broken.
Comment #14
brianV commentedMoving to 7.x
Comment #15
carlos8f commentedsubscribing
Comment #16
seanburlington commentedThis seems like an important missing piece of API to me
Comment #17
mr.baileysThe theme-key portion of this patch seems to have been implemented by #581118: Blocks admin user interface should not do theme switching
Comment #18
andypostIs this still an issue?
Comment #19
seanburlington commentedIf the function is usable externally it should be renamed as block_rehash()
Comment #20
elliotttf commentedThe theme issue does appear to be fixed as mentioned above; however, I agree with #19 that if the goal is to make this function globally reusable it should be renamed to block_rehash().
I've attached a patch to accomplish this. Note that this patch will break any contrib modules that currently call _block_rehash. An alternative way around this (although not very clean) would be to leave _block_rehash() as is and create a new function block_rehash() that just calls _block_rehash().
Comment #21
elliotttf commentedComment #22
seanburlington commentedthere is only a single module in contrib that uses the function so renaming should be managable
patch looks good to me
Comment #23
webchickAPI change => Drupal 8.
Comment #24
seanburlington commentedSurely "private" functions don't form part of the API ??!
So effectively this is just adding to the API which should be OK - even after launch if it's too late for 7.0
Comment #25
EvanDonovan commentedSubscribing. I have noticed there are cases in which I want to change which blocks are available programmatically, and would like to have a more elegant way to do so than with a function that has a hardcoded variable.
Comment #26
dries commentedDoes not apply against 8.x so setting to 'needs work' and asking for a re-test.
Comment #27
dries commented#20: block_rehash.patch queued for re-testing.
Comment #29
andypostseems not valid for now so could be closed
Comment #30
internetdevels commentedAs task hasn't been closed I've prepared new patch.
Comment #31
andypostSuppose better for d8 move this function to some manager method,
The function is not a part of API because starts from '_' so better not introduce api change here
Comment #32
internetdevels commentedNew patch attached.
Comment #33
tim.plunkettWe need a better place to put this. It returns an array of block entities, while this is the manager for block plugins. I think a new class is needed.
This needs to be blockRehash()
Comment #34
xjmClosing as a duplicate of #2514998: Reduce fragility in the monolithic BlockListBuilder.