Teaser block not visible in block list
ztyx - September 20, 2008 - 17:05
| Project: | Teaser block |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | ztyx |
| Status: | needs review |
Description
/admin/build/block/configure/teaser_block/1 works and is reachable but does not show up in the list at /admin/build/modules.

#1
Follow-up:
teaser_block_list()returns all the blocks. But for some reason they are not presented.#2
Ah, finally. This bug is related to #252707: Setting $block['status'] but not $block['region'] hides the block in the interface.
I am attaching a patch that should prevent
statusbeing set to 1 ifregion == ''. Should solve the issue.#3
#4
Hm. I did not have any problems. Could you please elaborate under which conditions this bug occurs?
#5
Sure, I apologize for not writing a more clear bug report. Here we go:
1. Create a Teaser Block. Let it stay in the "Disabled"-region.
2. Go to the node that the Teaser Block is pointing to. Edit its body and press save (Teaser Block should say that it updated the status...).
3. Go back to block listing. Your Teaser Block should not be in the listing anymore.
Do manage to recreate this?
#6
Ok, I'm able to replicate this bug. However, this patch introduces a wrong behavior instead of fixing the bug - the additional WHERE clause will not update teaser blocks that are properly assigned to a region. So instead of this query, I think we should add this condition to the one right above it, and break the update if no ids are returned then.
#7
Hmm, I am not sure I fully understand you:
I think it will. It will update all teaser blocks that are assigned to a region (other than the null/empty region).
The question for me is whether it is necessary to ever update the status of a block when it's in the null region or not.
I am not 100% sure how you would do it by changing the SELECT - with a JOIN?
#8
You are right that the latest patch prevents that a teaser block, which is not assigned to a region, will be enabled.
The purpose of this update function is to ensure that a teaser block is unpublished when a node is unpublished, because the teaser block would link to an unpublished node otherwise. By adding
AND region != '', a disabled block won't be enabled. Did you also test what happens with already enabled blocks? Will they disappear or move to the disabled blocks section? And what happens if the corresponding node is published again? Is the teaser block displayed again?