Upgrading from 6.x-1.6 to 6.x-2.3, I was getting an extra region class for a region that had no content.

My solution in the patch that follows is to check whether any fields in the region have content, before adding the class.

I'm not at all sure that this won't mess with the empty region plugin, but I couldn't find anywhere else to remove it. Any pointers as to how it can be done better (or if the region field should even be there at this stage if it has no content) would be welcome.

Comments

lazysoundsystem’s picture

StatusFileSize
new828 bytes

And here's the patch.

xtfer’s picture

Status: Active » Needs review
nightlife2008’s picture

I have this bug also, but the above patch doesn't seem to resolve the issue when

- The content is in the middle
- The Left / Right sidebar HAS a field for display.

it seems the $value['content'] is NULL but the $value['rendered'] is not FALSE, when the field is an Image field...

I had to rework the foreach loop as follows (from ds.module, line 645):

      if ($region_name == 'left' || $region_name == 'right') {
        //$object_display->region_classes[$region_name] = $region_name;
        $has_content = FALSE;
        foreach ($region_fields as $key => $value) {
          if ( FALSE !== $value['rendered'] || !empty($value['content']) ) {
            $has_content = TRUE;
            break;
          }
        }
        if ( $has_content ) {
          $object_display->region_classes[$region_name] = $region_name;
        }
      }
aspilicious’s picture

Issue summary: View changes
Status: Needs review » Closed (won't fix)

Closing all the drupal 6 issues as support for that version has been dropped.