Recently a new feature made it into Panels Mini + Ctools that creates an optional checkbox on a required context that states: "This context need not be present for the component to function." For more information please see:

#1588212: Add "optional" checkbox to require contexts within mini panels
#2405187: Add "optional" checkbox for required contexts

The problem was the Block code logic wasn't changed to support this addiiton. So while whenever using the CTools plugin for display Panels Mini will react properly. When using the Block system to render a Mini Panel it will be stripped out since there is a required context but nothing seen in the $current_page['context'].

I slightly modified the hook_block_list_alter function to support this recent addition.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

sylus’s picture

sylus’s picture

Status: Active » Needs review
Related issues: +#1588212: Add "optional" checkbox to require contexts within mini panels
JonMcL’s picture

Status: Needs review » Reviewed & tested by the community

You just saved me from a check-in the mental hospital. Thank you!

This works for me!. Would love to see this included as it is definitely a bug. I added an optional 'node' context to a mini-panel I display via a Block. The block disappeared from all pages. Applying this patch fixed it and allowed me to set individual rules on panes based on the optional node context.

JonMcL’s picture

Status: Reviewed & tested by the community » Needs review

I'm not sure I know what I'm doing. This might very well work, but not the solution to my problems.

andrbmgi’s picture

#1 confirmed working!