Needs review
Project:
Teaser block
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
20 Sep 2008 at 17:05 UTC
Updated:
23 Sep 2008 at 02:56 UTC
Jump to comment: Most recent file
/admin/build/block/configure/teaser_block/1 works and is reachable but does not show up in the list at /admin/build/modules.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | prevent_status_w_no_region.patch | 900 bytes | ztyx |
Comments
Comment #1
ztyx commentedFollow-up:
teaser_block_list()returns all the blocks. But for some reason they are not presented.Comment #2
ztyx commentedAh, finally. This bug is related to #252707: Setting $block['status'] is not actually useful.
I am attaching a patch that should prevent
statusbeing set to 1 ifregion == ''. Should solve the issue.Comment #3
ztyx commentedComment #4
sunHm. I did not have any problems. Could you please elaborate under which conditions this bug occurs?
Comment #5
ztyx commentedSure, 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?
Comment #6
sunOk, 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.
Comment #7
ztyx commentedHmm, 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?
Comment #8
sunYou 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?