The custom class is not rendered when using a block (generated from views + with a custom class configured) and inserted into a panel (pane).

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

nicobot’s picture

In order to address this issue, I've prepared the attached patch. It will work when selecting the pane style "System block".

nicobot’s picture

Assigned: nicobot » Unassigned
Status: Active » Needs review
nicobot’s picture

Version: 7.x-2.1 » 7.x-2.x-dev
nicobot’s picture

I've found a problem with default views blocks, they are rendered with a different delta (block_name-default) from what it is being saved in the DB (block_name-block).

nicobot’s picture

Attaching patch for #4 comment

DYdave’s picture

Hi @nicobot,

Thank you very much for posting this issue and for submitting patches to attempt to fix the problem.
Your contributions are certainly greatly appreciated.

Sorry I didn't step in earlier, but I wanted to see if this could get some more testing and feedback from others, before I'd dive in.
Just a quick comment to see if you would think there would be any relationship between this issue and #1386774: Panels and related modules: Compatibility issues.

I personally haven't tested any of the patches or reproduced any of the problems reported in these two tickets.
So I would greatly appreciate if you could please update these issues accordingly with the Related or Parent issue fields, or even perhaps the status (if any issue is a duplicate of the other). For example, maybe, this issue's parent should be #1386774: Panels and related modules: Compatibility issues, if the patch there would be required and if you would think it covers more general cases.
Otherwise, it would make sense to me if these two issues were at least Related.

Also, have you tested the patch from #1386774-8: Panels and related modules: Compatibility issues? Is it required for #2331523: Views Blocks in Panel panes (rendered as system blocks) to display custom CSS classes correctly?

Feel free to let us know if you would have more comments, questions, issues or patches to contribute for either of these issues related with Panels and Blocks.
Thanks in advance for your help, comments, testing/reporting, reviews and feedback.
Cheers!

Chris Matthews’s picture

Status: Needs review » Needs work
Issue tags: +Needs reroll, +Needs rework

The 4 year old patch in #5 does not apply to the latest 7.x-2.x dev snapshot and may be too old to reroll, but I went ahead and tagged the issue accordingly.

Checking patch block_class.module...
error: while searching for:
 */
function block_class_preprocess_block(&$vars) {
  $block = $vars['block'];
  if (isset($block->css_class) && $block->css_class != '') {
    $vars['classes_array'] = array_merge($vars['classes_array'], explode(' ', $block->css_class));
  }

error: patch failed: block_class.module:29
error: block_class.module: patch does not apply