`panels_flexible_render_item` function of flexible layout plugin does strange things which are simply can't be explained from user point of view.

In admin UI of flexi layout columns and rows, there is field for setting CSS-class field. The help text states:
Enter a CSS class that will be used. This can be used to apply automatic styling from your theme, for example.

Good. But this isn't true actually since no rows or columns markup is created if you have only 1 column and 1 row with some regions in it:

function panels_flexible_render_item($renderer, $item, $content, $id, $position, $max, $clear = FALSE) {

  // If we are rendering a row and there is just one row, we don't need to
  // render the row unless there is fixed_width content inside it.
  if (empty($renderer->admin) && $item['type'] == 'row' && $max == 0) {
    $fixed = FALSE;
    foreach ($item['children'] as $id) {
      if ($renderer->settings['items'][$id]['width_type'] != '%') {
        $fixed = TRUE;
        break;
      }
    }

    if (!$fixed) {
      return $content;
    }
  }

  // If we are rendering a column and there is just one column, we don't
  // need to render the column unless it has a fixed_width.
  if (empty($renderer->admin) && $item['type'] == 'column' && $max == 0 && $item['width_type'] == '%') {
    return $content;
  }

This code does nothing useful and I think it should be removed.

I marking this as a bug. Steps to reproduce:

1) Create a flexi panel with 1 col 1 row and some regions and place content there.
2) Configure column and/or row and set some CSS class to them.
3) When the panel is rendered, they are no any classes.

CommentFileSizeAuthor
#2 1852532-2.patch811 bytesAngry Dan
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

OnkelTem’s picture

Title: Flexible layout: strange behavior » Flexible layout: strange behavior (markup isn't generated for rows and columns)
OnkelTem’s picture

Issue summary: View changes

Updated issue summary.

OnkelTem’s picture

Issue summary: View changes

Updated issue summary.

Angry Dan’s picture

Status: Active » Needs review
FileSize
811 bytes

I agree! I spent ages trying to work out why my classes weren't appearing. I hadn't thought of removing all of the code... I went for a patch (attached) instead but whatever to rid this irritation.

robmcbryde queued 2: 1852532-2.patch for re-testing.