Fails to detect new blocks?

voxpelli - September 16, 2009 - 13:30
Project:Domain Blocks
Version:6.x-1.1
Component:Code
Category:bug report
Priority:critical
Assigned:Unassigned
Status:needs work
Description

I added a new block through Views and it appeared as it should in the block list but when assigned to a region it wasn't rendering.

I tracked down the bug to be that a row never was added to the domain_blocks table which lead to the SQL query fetching all the regions blocks to exclude that block.

I could temporarily solve it by going in and save the settings for that specific block - but the long term solution would be for this module to automatically detect the addition and removal of blocks.

#1

nonsie - September 17, 2009 - 16:56
Status:active» by design

Actually this is by design at the moment. A patch is welcome but it would need to keep current functionality eg. automatically adding new blocks vs manually adding new blocks to the domain_blocks table should be a configuration option.

#2

voxpelli - October 16, 2009 - 09:55
Priority:normal» critical
Status:by design» active

Even though this happens by design the intention is not by design - this should be considered an undesired behavior and ultimately something that needs to be corrected as soon as possible :)

I'm reopening it and marking it as critical - because it's really bothering me - I'm always forgetting to do the extra save.

#3

nonsie - October 16, 2009 - 16:16

Patches welcome;) I probably won't get to it for a while.

#4

RoboPhred - November 2, 2009 - 01:54
Assigned to:Anonymous» RoboPhred

The real issue is that new blocks have no domain selected, but by design the block should be available to all domains if no domains are selected. This is shown by the fact that while the block starts out as showing up for no nodes, yet submitting the block configuration screen without changing anything causes the block to show up for all domains.

I will work on a patch for this.

#5

RoboPhred - November 6, 2009 - 19:56

Unfortunately I cannot work on this. However, I did some looking into this, and it doesn't appear there are any hooks to react to the enabling or installing of blocks. With this case, the change can only be done in the sql query alter hook where the block's domain is applied; it needs to either be reworked to treat none as all, or trigger a block save event to populate the table entries.

#6

RoboPhred - November 6, 2009 - 19:56
Assigned to:RoboPhred» Anonymous

#7

nonsie - November 14, 2009 - 02:06
Status:active» needs work

Here's a patch that will enable a block on all domains (domain_site grant) on block_admin_display_form submit if it has no record in domain_blocks table.
The downside is that is you have a block in a region other than BLOCK_REGION_NONE it will show up on all sites. There is no way to disable it besides moving it into disabled blocks.

AttachmentSize
579044-domain_blocks.module.patch 2.07 KB
 
 

Drupal is a registered trademark of Dries Buytaert.