Blocks started disappearing for me since I upgraded Panels and Ctools. Please see my comment on this ticket for more information http://drupal.org/node/1786950#comment-6531414

When you display a Block within a Pane, ctools invokes block_list(), which determines visibility based on settings in the Block configuration form.

Panel visibility rules should take precedence over Block visibility rules, right?

Commenting out drupal_alter('block_list', $block_info); in ctools/plugins/content_types/block/block.inc solved the issue for me.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

iancawthorne’s picture

I can confirm I am experiencing the same issue. Only updating ctools from 1.1 to 1.2 appears to break things for me. As soon as ctools 1.2 is running, my blocks which are within a panel display are getting hidden based on the block visibility.

Is this intended behaviour? As it did not do this in ctools 1.1 and previous.

leewillis77’s picture

jantoine’s picture

Status: Active » Needs review
FileSize
599 bytes

A temporary workaround until brighter eyes have a chance to look at this is to override the status flag forcing the core block module to leave the block in the blocks list.

jojonaloha’s picture

I also had this problem when updating to 1.2 (perviously on 1.0). I did a diff between 1.1 and 1.2 and reverted just ./plugins/content_types/block/block.inc which fixed the issue for me. I can also confirm that the patch in #3 is a working workaround for this issue.

jojonaloha’s picture

Status: Needs review » Fixed

I'm fairly certain this was resolved with ctools 7.x-1.3.

Steps to Reproduce
I was able to reproduce the issue again using (without the patch in #3):
Drupal 7.21
Ctools 7.x-1.2
Panels 7.x-3.3

- Create a block with visibility setting set to "Only the listed pages"; list some pages.
- Create a panel page with a path that is not listed in the blocks visibility settings, add the block to the panel

Result
The block is not displayed.

After updating to ctools 7.x-1.3 and clearing caches, the block will display properly.

iancawthorne’s picture

Confirmed that 1.3 resolves this problem for me.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

cha0s’s picture

Status: Closed (fixed) » Needs work

I don't think this is a satisfactory solution. My DRY senses are tingling. I believe a real solution would be having a visibility rule in panels that says something along the lines of 'defer visibility rules to block', otherwise we have to maintain two lists of visibility rules which is nasty.

Also, it's MUCH better UX for clients to click the gear in a pane and 'configure block' than to have to wade into a panel configuration page, IMO.

I can't be the only one who feels this way?

joelpittet’s picture

Version: 7.x-1.2 » 7.x-1.x-dev
Issue summary: View changes

This seems to happen in the reverse now. Block visibility rules are completely ignored.

misthero’s picture

agree with joelpitt, same here

jojonaloha’s picture

In my opinion, they should be ignored when you place a block in panels. If we respect those rules, then there is no way to override them for a specific panel page. Whereas if we ignore them, then panels visibility rules can be used.

I do think that an option like cha0s suggests might be in order though. At least that way the expected behavior would be explicitly defined.

misthero’s picture

Yes, an option to "respect block visibility rules" would be in order, same use case as cha0s: block visibility configuration is easier to reach and more user friendly for clients.

MustangGB’s picture

Category: Support request » Bug report