I have been migrating a site that makes heavy use of views and panels from D5 to D6 (52 panel pages, 48 panel views and 36 views all stored in code and being loaded by their respective default_[type]() hooks). I am very aware that all this code is still in beta phase and this kind of upgrade is definitely an edge case. However I thought I would provide some feedback from my upgrade experience:

I loaded all views, panel views and panel pages into the db as local versions to ease the update. After a little bit of fussing with the module update order; core first, then contrib, then views and panels. The views and panels updated without trouble.

The issue I am striking is that all links between panel views and their respective (updated) views are broken. A snippet of the exported $pane object shows the problem:

Here is the $pane that should be referencing the view:

  $pane = new stdClass;
  $pane->pid = 'new-7';
  $pane->panel = 'right';
  $pane->type = 'views2';
  $pane->subtype = 'groups_page';
  $pane->shown = TRUE;
  $pane->access = array();
  $pane->configuration = array(
    'override_title' => 0,
    'override_title_text' => '',
    'title' => 'Groups - Page',
    'name' => 'groups_page',
  );
  $pane->cache = array();
  $pane->style = array(
    'style' => 'default',
  );
  $pane->css = array(
    'css_id' => 'round-silver-left',
    'css_class' => '',
  );  
  $pane->extras = array();  
  $pane->position = 0;  
  $display->content['new-7'] = $pane;  
  $display->panels['right'][0] = 'new-7';

I manually added the updated view to the panel's display directly underneath the broken one. Here is its exported object:

  $pane = new stdClass;
  $pane->pid = 'new-8';
  $pane->panel = 'right';
  $pane->type = 'views';
  $pane->subtype = 'groups';
  $pane->shown = TRUE;
  $pane->access = array();
  $pane->configuration = array(
    'nodes_per_page' => '10',
    'pager_id' => '1',
    'use_pager' => 0,
    'offset' => '0',
    'more_link' => 0,
    'feed_icons' => 0,
    'panel_args' => 0,
    'link_to_view' => 0,
    'args' => '',
    'url' => '',
    'display' => 'default',
    'override_title' => 0,
    'override_title_text' => '',
  );
  $pane->cache = array();
  $pane->style = array();
  $pane->css = array();	
  $pane->extras = array();
  $pane->position = 1;
  $display->content['new-8'] = $pane;
  $display->panels['right'][1] = 'new-8';

I believe (aside from the panel view configuration) the key lines are:

  $pane->type = 'views2';
  $pane->subtype = 'groups_page';
  //...
  $pane->position = 0;

('groups_page' was the name of the panel view.)

Should be:

  $pane->type = 'views';
  $pane->subtype = 'groups';
  //...
  $pane->position = 1;

(Seems that this isn't using a panel view.)

From what I can see I assume there currently is no upgrade path from panels_views-5.x-2.0-rc1a to ctools views_content?

My plan is to just write a drush script that will loop through all the display objects and update the view panes individually. - I have a similar script for panels 2 floating around somewhere that I should be able to base it off.
I will post an update here once I have it going.

However, if there is a simpler/easier way to go about this (or if I have missed something in the update process) please let me know. Writing the script feels kind of dirty.

BTW thanks for all your work on panels views etc - they're some awesome tools! The new panels UI is a huge improvement!

Comments

merlinofchaos’s picture

Oh wow, views2. Yes indeed I think I never accounted for that particular version of views panes and there is no upgrade path from it to the current version. Hmm. That could be a little tricky, too. I think I may've decided not to bother because the panels_views methodology changed so much (instead of being its own intermediate object it became a display attached to the view) that I didn't know a good way to automate it.

For your purposes the script is likely your best bet.

tnightingale’s picture

Cheers,
Ill post the script back here once its sorted out.

tnightingale’s picture

Status: Active » Closed (won't fix)