I have a department content type where I use Panelizer enabled for "Full page override." When I click "customize this page" using the IPE everything seem to be fine until I hit "save as default." I am then shown a js dialog that tells me "this will save this configuration as the new default....". I hit ok and then I get another js dialog with this error:

An AJAX HTTP error occurred.
HTTP Result Code: 200
Debugging information follows.
Path: /panels/ajax/ipe/save_form/panelizer%3Anode%3A208%3Apage_manager
StatusText: OK
ResponseText: Strict warning: Creating default object from empty value in panelizer_panels_cache_save() (line 1211 of /Users/glenn/websites/7c9d097f-0bc1-457d-8314-1d9e37f102bf/profiles/cmf/modules/contrib/panelizer/panelizer.module). =>
*/

Let me know if I can provide any more information. I'm running this locally on a Mac using Acquia Dev Desktop along with Google Chrome. I'm running the latest devs of Panels-3.x, Panelizer-3.X, and ctools.

In my logs I see the following:

Notice: Undefined property: stdClass::$export_type in panelizer_export_save_callback() (line 939 of /Users/glenn/websites/7c9d097f-0bc1-457d-8314-1d9e37f102bf/profiles/cmf/modules/contrib/panelizer/panelizer.module).

Hope that helps

Comments

merlinofchaos’s picture

Hm. That's really weird. That suggests that, for some reason, this line is failing for you:

Unless your line numbering is significantly different from what's in -dev right now, that's failing on a piece of code that shouldn't actually be running. Can you check panelizer.module and give me 3 or 4 lines around the line that is failing there?

gmclelland’s picture

Starting at 929
939 is the line if ($object->export_type & EXPORT_IN_DATABASE)

function panelizer_export_save_callback(&$object) {
  if (!empty($object->display)) {
    // First write the display
    panels_save_display($object->display);

    // Make sure we have the did.
    $object->did = $object->display->did;
  }

  // Then write the default
  if ($object->export_type & EXPORT_IN_DATABASE) {
    // Existing record.
    $update = array('pnid');
  }
  else {
    // New record.
    $update = array();
    $object->export_type = EXPORT_IN_DATABASE;
  }

  return drupal_write_record('panelizer_defaults', $object, $update);
}

I will replace the module again with a fresh download of the dev release and set if that helps.

gmclelland’s picture

Just replaced with a fresh copy of panelizer module 3.x-dev

starting at 1209
line 1211 is the line $panelizer->display = $cache->display;

if (!empty($get_default)) {
    $panelizer = $handler->get_default_panelizer_object($bundle, $name);
    $panelizer->display = $cache->display;
    ctools_include('export');
    ctools_export_crud_save('panelizer_defaults', $panelizer);
  }

This is included in the function panelizer_panels_cache_save($argument, $cache) {

merlinofchaos’s picture

Sorry, I was referring to the one in the ResponseText at line 1211. I hadn't progressed to the next one yet, though I'll look at that too.

merlinofchaos’s picture

Ah. Yes, that error is just an extension of the first error. It does suggest that our line numbering IS the same, but that just leaves me confused as that shouldn't be an issue.

Question: What the panelizer configuration for the node type? Is 'has default' checked?

gmclelland’s picture

StatusFileSize
new74.54 KB

Yes, provide default panel is checked. See attachment.

merlinofchaos’s picture

At line 1210, can you use error_log() to find out what the values of $bundle and $name it has acquired and using are?

gmclelland’s picture

I'm not sure if I'm doing this way you are wanting, but I added the following after line 1210

error_log($bundle, 3, "/users/glenn/Desktop/temp/deleteme.txt");
and it printed "department.page_manager" inside of deleteme.txt

Then I changed it to:
error_log($name, 3, "/users/glenn/Desktop/temp/deleteme.txt");

but nothing printed inside of deleteme.txt

merlinofchaos’s picture

Status: Active » Needs review
StatusFileSize
new858 bytes

Try this patch.

merlinofchaos’s picture

Status: Needs review » Fixed

I'm pretty confident this fixes the issue, though the OP appears to be having other issues discussed on IRC. I think these are unrelated and need to be handled separately.

Committed this patch.

Status: Fixed » Closed (fixed)

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

leahtard’s picture

Issue summary: View changes

I was getting the same AJAX error as @gmclelland and my panel layout changes were not saving. I just wanted to confirm that the patch in #9 fixed my issue.

Cheers, Leah