/admin/build/block/configure/teaser_block/1 works and is reachable but does not show up in the list at /admin/build/modules.

CommentFileSizeAuthor
#2 prevent_status_w_no_region.patch900 bytesztyx

Comments

ztyx’s picture

Assigned: Unassigned » ztyx

Follow-up: teaser_block_list() returns all the blocks. But for some reason they are not presented.

ztyx’s picture

StatusFileSize
new900 bytes

Ah, finally. This bug is related to #252707: Setting $block['status'] is not actually useful.

I am attaching a patch that should prevent status being set to 1 if region == ''. Should solve the issue.

ztyx’s picture

Status: Active » Needs review
sun’s picture

Hm. I did not have any problems. Could you please elaborate under which conditions this bug occurs?

ztyx’s picture

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?

sun’s picture

Status: Needs review » Needs work

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.

ztyx’s picture

Hmm, I am not sure I fully understand you:

- the additional WHERE clause will not update teaser blocks that are properly assigned to a region.

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?

sun’s picture

Status: Needs work » Needs review

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?