When you create a default panel for a content type (http://example.com/admin/config/content/panelizer) it is not given a valid context, so the default content panes are invalid. This only affects the D7 port, the D6 port behaves correctly.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

DamienMcKenna’s picture

Interestingly, panelizer_get_default_display_node(), which creates the default panel, is the same for both D6 and D7, so presumably something else in the API changed.

DamienMcKenna’s picture

Status: Active » Needs review
FileSize
1.1 KB

Part of the problem - the context specs were not being displayed on the admin/config/content/panelizer/node/[type]/context page, this patch fixes the Form API changes in D7.

DamienMcKenna’s picture

Status: Needs review » Needs work

This isn't completely fixed yet..

DamienMcKenna’s picture

Right now, when you go to admin/config/content/panelizer/node/[type]/content it whitescreens. This page calls panelizer_default_content_page(), which then calls panelizer_edit_content($panelizer); this function contains the following:

  if (!empty($panelizer->nid)) {
    $cache = panels_edit_cache_get('panelizer:node:' . $panelizer->nid);
  }
  else if (is_numeric($panelizer->did)) {
    $panelizer->display = panels_load_display($panelizer->did);
    $cache = panels_edit_cache_get_default($panelizer->display, $panelizer->panelizer_type);
  }
  else {
    return;
  }

The problem is that if the settings have not been saved yet the $panelizer->did value is NULL, thus it gets to the end and just returns a blank screen.

DamienMcKenna’s picture

I temporarily solved the problem from #4 with the following extra code added just before the else{} block:

  else if (!empty($panelizer->display)) {
    $cache = panels_edit_cache_get_default($panelizer->display, $panelizer->panelizer_type);
  }

Still working on it..

DamienMcKenna’s picture

Another part of the problem is that the general panelizer_edit_content() function uses the entity-specific panelizer_save_node_panelizer() function to save the data. Naughty!

DamienMcKenna’s picture

Status: Needs work » Needs review
FileSize
5.65 KB

#6 turns out to be a core problem here, so here's a fix that restores the original panelizer_default_content_page() and moves the panelizer_edit_content() code back into panelizer_edit_node_content_page(); I've also included the fix from #2 above.

merlinofchaos’s picture

Status: Needs review » Fixed

Committed, pushed.

Status: Fixed » Closed (fixed)

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