Hello,

I am trying out the MiniPanel wherein I am creating (as an example) 2 flexible minipanels within a Panel with rounded corners.

Evreything works well without a problem when I have one MiniPanel withing a Panel or a Panel without minipanels.But the problem happens when I try to add the second Minipanel.The content looks good but the second one looses its rounded corners.Happens with any number of new mini panels added.

The module is simply great ( one of the best in drupal) and hope this is fixed .

P.S: I am new to drupal and may have missed some key info to make it a complete 'Issue Ticket' .Please indicate if you need furthur information or if you would want any 'testing' help for this incredible module

Comments

snelson’s picture

Version: 5.x-2.0-beta2 » 5.x-2.0-rc1a
Status: Active » Needs review

I ran into this same issue ...

In rounded_corners.inc, panels_add_rounded_corners_css(), we have:

function panels_add_rounded_corners_css($display, $where) {
  static $displays_used = array();
  if (empty($displays_used[$display->name])) {
    theme('rounded_corners_css', $display, $where);
    $displays_used[$display->name] = TRUE;
  }
}

Basically, this prevents the rounded corners CSS from being added twice. The problem is $display->name is always null, so the CSS is only added once. Not sure if $display->name not supposed to exist, but its briefly mentioned here: http://drupal.org/node/215874.

Note: the project I'm working on is an upgrade from Panels 1.x, so that could have something to do with it as well.

The fix is really easy, I changed the above function to use $display->css_id instead of $display->name:

function panels_add_rounded_corners_css($display, $where) {
  static $displays_used = array();
  if (empty($displays_used[$display->css_id])) {
    theme('rounded_corners_css', $display, $where);
    $displays_used[$display->css_id] = TRUE;
  }
}

Changing the module code itself is not good though, so hopefully the fix can get into the release.

Cheers,
Scott

dellintosh’s picture

Assigned: Unassigned » dellintosh
Status: Needs review » Reviewed & tested by the community
StatusFileSize
new380 bytes

Applied patch, tested, works! :)

Later,
dellintosh

(Also attaching patch file here to simplify implementation into codebase.)

sdboyer’s picture

Heh, wow...$display->name. That's a blast from the past. Good catch there, snelson, and thanks for the review dellintosh. In future, though, if it'd be possible for you to do a unified diff against CVS, that's the most preferable option.

Committed.

sdboyer’s picture

Status: Reviewed & tested by the community » Fixed
Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.