Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#3 | ctools-override-block-visibility-1797300.patch | 599 bytes | jantoine |
Comments
Comment #1
iancawthorne CreditAttribution: iancawthorne commentedI 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.
Comment #2
leewillis77 CreditAttribution: leewillis77 commentedPossibly a side effect from #1168272: Drupal blocks are shown untranslated ?
Comment #3
jantoine CreditAttribution: jantoine commentedA 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.
Comment #4
jojonaloha CreditAttribution: jojonaloha commentedI 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.
Comment #5
jojonaloha CreditAttribution: jojonaloha commentedI'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.
Comment #6
iancawthorne CreditAttribution: iancawthorne commentedConfirmed that 1.3 resolves this problem for me.
Comment #8
cha0s CreditAttribution: cha0s commentedI 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?
Comment #9
joelpittetThis seems to happen in the reverse now. Block visibility rules are completely ignored.
Comment #10
misthero CreditAttribution: misthero commentedagree with joelpitt, same here
Comment #11
jojonaloha CreditAttribution: jojonaloha commentedIn 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.
Comment #12
misthero CreditAttribution: misthero commentedYes, 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.
Comment #13
MustangGB CreditAttribution: MustangGB commented