As far as I can tell, the following still needs to happen:

  1. Preprocess handler hooks need to be properly updated to use "panels_region" instead of "panels_panel"
  2. skinr table needs to update occurrences of panel, i.e. "display-1-panel-column_1" to "display-1-region-column_1"
  3. If panels_panel is detected in .info files, we should log an error or something that updates are required
  4. The previous version of panels is actually broken when Skinr settings are applied to regions. I committed a patch a few minutes ago to attempt to gracefully solve this, but I'm not sure it's right or that it should stay
  5. We also need to address this #727386: "Cog" missing from all panels and panes that don't actually have Skins applied.

That's all I've got right now.

Comments

delykj’s picture

According to http://drupal.org/node/866184#comment-3408576 is there any progress to Skinr work with Panels regions?

moonray’s picture

StatusFileSize
new2.17 KB

I've got a patch for points 1. 2. and 4.
Please test and review with panels 3.5.

moonray’s picture

Status: Active » Needs review
jacine’s picture

I started testing this on 3.7 with Skinr 1.x and it doesn't work for regions. I've been trying to figure out why for the last 1.5 hours and haven't been able to get past this yet, because:

  • Reference to "panel" instead of "region" for $sid in theme_panels_skinr_style_render_region() so it's not looking up the skin information.
  • $region_id is always empty.
  • There's a new class for panel separator and that wasn't accounted for in the change.
jacine’s picture

Status: Needs review » Needs work
jacine’s picture

And good thing it doesn't work, because as I'm figuring it out, I realize there is no skinr_flatten_skins_array() function in 1.x. Sigh.

jacine’s picture

A database update is also needed for the variables table... 1.x.

jacine’s picture

StatusFileSize
new3.34 KB
new3.11 KB

Here are 2 working patches for Panels 3.7 for 1.x-dev and 2.x-dev. Panels 3.7 has been out for 3 months now, so supporting the old version would be a waste.

I would like to commit this and roll a release for 1.x ASAP, but an update function for the variables table is still needed and I don't know how to do that.

jacine’s picture

Here's an an example from the variables table for a theme named "skinr_one"

1. The variable is called skinr_skinr_one.
2. The value of it is:

a:1:{s:6:"panels";a:2:{s:21:"display-1-panel-left";a:3:{s:11:"test_select";s:0:"";s:11:"test_radios";s:0:"";s:15:"test_checkboxes";a:2:{s:24:"test-checkboxes-option-1";s:24:"test-checkboxes-option-1";s:24:"test-checkboxes-option-2";s:24:"test-checkboxes-option-2";}}s:16:"display-1-pane-1";a:3:{s:11:"test_select";s:0:"";s:11:"test_radios";s:0:"";s:15:"test_checkboxes";a:0:{}}}}

In this example, the occurrences of "panel" need to change to regions, e.g.

Old: "display-1-panel-left"
New: "display-1-region-left"

:)

ezra-g’s picture

Status: Needs work » Needs review
StatusFileSize
new5.08 KB

Here's a re-roll for 1.x that includes updating variable values. I tested that this successful renames the sample variable that jacine provided, but it would be great to get some functional testing in another environment.

Status: Needs review » Needs work

The last submitted patch, 922136-1.x-a.patch, failed testing.

ezra-g’s picture

Status: Needs work » Needs review

It seems like all the 6.x-1.x patches are failing because this is marked as 6.x-2.x -- still needs review ;).

jacine’s picture

Status: Needs review » Needs work
StatusFileSize
new151.69 KB

Oy, this isn't working :(

The changes in Ezra's patch (#10) work (they make the right changes), but for whatever reason, panels is ignoring it. When I go to edit a region that was changed during this upgrade, the Skinr form is empty as if I had never selected anything in the first place. And now when I try to re-apply settings to a pane, I'm getting:

Fatal error: Cannot use string offset as an array in /Users/jacine/Sites/drupal-6/sites/skinr-1.x/modules/skinr/skinr.module on line 476 (see screenshot for more on this).

moonray’s picture

Status: Needs work » Needs review
StatusFileSize
new5.2 KB

The variables are stored serialized in the db, so you can't go and just str_replace things in there. Attached patch fixes the conversion in install.
Also, I found that panes weren't getting their skinr classes attached, so a fix for that is here as well. (We might want to check the 2.x version as well to make sure it's working there).

Status: Needs review » Needs work

The last submitted patch, skinr-1.x_922136.patch, failed testing.

moonray’s picture

Status: Needs work » Needs review
StatusFileSize
new4.66 KB

Looks like skinr 2.x patch also didn't have a working pane style being set.

jacine’s picture

Hmm, panes were working for me in both, and now regions are not anymore in 1.x so far. I guess I'll have to diff the two patches to see what actually changed.

jacine’s picture

Err, sorry never mind. My region style didn't apply properly. 1.x does work, which makes me very happy. Testing 2.x now.

jacine’s picture

Status: Needs review » Needs work

Here's what I found testing 2.x:

Before
- Regions were broken, so of course nothing was displaying but the same 2 classes were applied.
- The following classes were printed on panes:
panel-pane pane-custom pane-1 test-checkboxes-option-1 test-checkboxes-option-2 skinr-region skinr-id-1 skinr-region-processed

After
- Regions work properly, classes print out once like they should.
test-checkboxes-option-1 test-checkboxes-option-2

- Styles for panes print twice.
panel-pane pane-custom pane-1 test-checkboxes-option-1 test-checkboxes-option-2 test-checkboxes-option-1 test-checkboxes-option-2 skinr-region skinr-id-1 skinr-region-processed

The extra classes do not go away after:
- Clearing the cache.
- Re-saving the form via Panels.
- Re-saving the form via Dialog.

Before

$skinrs = array (
  'panels' => 
  array (
    'display-1-pane-1' => 
    array (
      'theme' => 'skinr_two',
      'module' => 'panels',
      'sid' => 'display-1-pane-1',
      'settings' => 
      array (
      ),
      'skins' => 
      array (
        'test_checkboxes' => 
        array (
          'test-checkboxes-option-1' => 'test-checkboxes-option-1',
          'test-checkboxes-option-2' => 'test-checkboxes-option-2',
        ),
      ),
    ),
    'display-1-panel-middle' => 
    array (
      'theme' => 'skinr_two',
      'module' => 'panels',
      'sid' => 'display-1-panel-middle',
      'settings' => 
      array (
      ),
      'skins' => 
      array (
        'test_checkboxes' => 
        array (
          'test-checkboxes-option-1' => 'test-checkboxes-option-1',
          'test-checkboxes-option-2' => 'test-checkboxes-option-2',
        ),
      ),
    ),
  ),
);

After

$skinrs = array (
  'panels' => 
  array (
    'display-1-pane-1' => 
    array (
      'theme' => 'skinr_two',
      'module' => 'panels',
      'sid' => 'display-1-pane-1',
      'settings' => 
      array (
      ),
      'skins' => 
      array (
        'test_checkboxes' => 
        array (
          'test-checkboxes-option-1' => 'test-checkboxes-option-1',
          'test-checkboxes-option-2' => 'test-checkboxes-option-2',
        ),
      ),
    ),
    'display-1-region-middle' => 
    array (
      'theme' => 'skinr_two',
      'module' => 'panels',
      'sid' => 'display-1-region-middle',
      'settings' => 
      array (
      ),
      'skins' => 
      array (
        'test_checkboxes' => 
        array (
          'test-checkboxes-option-1' => 'test-checkboxes-option-1',
          'test-checkboxes-option-2' => 'test-checkboxes-option-2',
        ),
      ),
    ),
  ),
);

So, it seems all that's left is stopping these classes from printing twice on panes.

jacine’s picture

I could have sworn I included that in the patch, but I didn't. It was my fault. :( This is what I'm still seeing:

In panels.skinr.inc:

function panels_skinr_form_index_handler($op, &$form, $form_state) {
  switch ($op) {
    case 'form':
    case 'submit':
      switch ($form['#parameters'][1]['type']) {
        case 'display':
          return 'display-'. $form['#parameters'][1]['display']->did;
        case 'panel': // Deprecated in Panels 3.7
        case 'region':
          return 'display-'. $form['#parameters'][1]['display']->did .'-region-'. $form['#parameters'][1]['pid'];
function panels_skinr_preprocess_hook_callback(&$form, $form_state) {
  switch ($form['#parameters'][1]['type']) {
    case 'display':
      return 'panels_display';
    case 'panel': // Deprecated as of Panels 3.7
    case 'region':
      return 'panels_region';
function panels_skinr_ajax_preprocess_hook_callback(&$form, $form_state) {
  if (strpos($form['skinr']['sid']['#value'], '-panel-') !== FALSE) {
    return 'panels_panel';
  }

In skinr.inc:

function skinr_skinr_panels_styles() {
  return array(
    'skinr' => array(
      'title'              => t('Skinr'),
      'description'        => t('Allows you to apply Skinr skins.'),
      // Render panel is deprecated as of Panels 3.7, but is left for backward
      // compatibility.
      'render panel'       => 'panels_skinr_style_render_region',
      // Introduced in Panels 3.7.
      'render region'      => 'panels_skinr_style_render_region',
moonray’s picture

I used the last available patch by ezra as my base. That patch must have reverted some of your changes.

jacine’s picture

Status: Needs work » Needs review
StatusFileSize
new6.4 KB
new6.4 KB

Ok, here's 2 patches that I think cover all of it. The reason I was getting the classes twice was because I was printing $skinr in panels-pane.tpl.php, and that variable contains the styles too. Not so hot consistency wise, but we may be better off leaving this be. :/

moonray’s picture

Status: Needs review » Reviewed & tested by the community

You've got a dsm() stuck in your 2.x patch, but otherwise they the 1.x and 2.x patches are good.
Remove the dsm() and we're good to go, I think.

jacine’s picture

Status: Reviewed & tested by the community » Fixed

Great, I fixed the dsm and committed, finally! Thank you :)

http://drupal.org/cvs?commit=439850
http://drupal.org/cvs?commit=439848

elviento’s picture

I have Panels 3.7, Ctools 1.7, and Skinr 1.5 installed. Does this allow one to 'Edit' content in the Panel and make it persistent ("keeps changes")?? ... I've been having issues making changes to my Panel ever since my upgrade of Panels/Ctools/Skinr. Just want to verify this happens to someone else before applying the patch, it is not clear!? Thanks.

Status: Fixed » Closed (fixed)

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