I know this error has been reported but not solved in many other areas, and probably for a variety of causes, but I had it occur specifically when I enabled a page panel as 'available to other pages' in D7. After attaching the panel to other pages the content within was blank/gone. I deleted the 'master' copy of the panel and got render errors until I hunted down all orphaned panels and deleted them, then everything reverted to normal.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

merlinofchaos’s picture

Status: Active » Postponed (maintainer needs more info)

The actual cause of this error is check_plain() being given an array, not a string. It can be hard to track down precisely where the error is coming from.

Getting a backtrace from the line in question when the variable is an array could be helpful. Otherwise there's not much I can do without being able to reproduce this.

jwilson3’s picture

Version: 7.x-1.x-dev » 7.x-1.0-alpha4
FileSize
1.97 MB

I was able to confirm this error, and have backtraces to boot.

Steps to recreate:

  1. Create a panel that you can use to test somewhere for display. In my case, I've created a node-view variant for a custom content type.
  2. Add content to the panel by clicking the gear in the upper-left hand corner of one of the panel regions, and selecting "Add content".
  3. Select the 'New custom content' from the sidebar of the pop-up dialog, and create some content. In my case, I'm creating a horizontal rule, that can be used as a custom pane separator, where I need it.
  4. Administrative title: "Horizontal Rule"
  5. Title: leave blank
  6. Body: "<hr>"
  7. Text format: "Full html"
  8. Uncheck "use content keywords".
  9. Check "Make this content reusable".
  10. Machine name: "horizontal_rule"
  11. Category: "Page elements"
  12. Administrative description: "Add a horizontal rule as a pane separator."
  13. Click Finish.
  14. The error message appears now both in the Panel-building admin interface under the Content tab, while trying to render the new custom pane; it also happens when trying to view the panel normally on the front end.

The object, exported to code via features looks like this: Note the two different settings called 'format':

/**
 * @file
 * horizontal_rule.ctools_content.inc
 */

/**
 * Implements hook_default_ctools_custom_content().
 */
function horizontal_rule_default_ctools_custom_content() {
  $export = array();

  $content = new stdClass;
  $content->disabled = FALSE; /* Edit this to true to make a default content disabled initially */
  $content->api_version = 1;
  $content->name = 'horizontal_rule';
  $content->admin_title = 'Horizontal Rule';
  $content->admin_description = 'Add a horizontal rule as a pane separator.';
  $content->category = 'Page elements';
  $content->settings = array(
    'admin_title' => 'Horizontal Rule',
    'title' => '',
    'body' => array(
      'value' => '<hr>',
      'format' => 'full_html',
    ),
    'format' => 'plain_text',
    'substitute' => 0,
  );
  $export['horizontal_rule'] = $content;

  return $export;
}

A backtrace (placed at check_plain) shows me that it is being passed the "body" array. I believe that somehow the logic in ctools is trying to pass the body because the format.

Interestingly enough, changing the outer-most format setting to 'full_html' in my feature does remove this error, but adds a different one in a different place (I won't mention that now, because I dont think its the proper solution in the first place, just something I tried to see if it would fix it quickly).

I've attached the backtrace, formatted with krumo, for your convenience, just download the html.txt file and remove the txt to display it properly in a web browser.

jwilson3’s picture

Status: Postponed (maintainer needs more info) » Active

Note: changing the exported settings to the following, solves the immediate issue, removing all error messages.

//...
  $content->settings = array(
    'admin_title' => 'Horizontal Rule',
    'title' => 'Horizontal Rule',
    'body' => '<hr>',
    'format' => 'full_html',
    'substitute' => 0,
  );
//...
jwilson3’s picture

Version: 7.x-1.0-alpha4 » 7.x-1.x-dev

I'm running 1.x-dev btw.

mstrelan’s picture

Version: 7.x-1.0-alpha4 » 7.x-1.x-dev
Priority: Minor » Major

Same issue as #2. Setting to major because it can result in loss of data, ie. if you set a pane to reusable and that pane had content the only way to see that pane again is to delete it and re-add it.

mstrelan’s picture

The attached patch will fix the issue for #2 and shouldn't break existing functionality if this is working anywhere else.

mstrelan’s picture

Status: Active » Needs review

Sorry for the 3 posts in a row, changing status.

merlinofchaos’s picture

Status: Needs review » Fixed

Committed a different version of this patch that corrects the problem in every place I ran into it.

merlinofchaos’s picture

Note that technically the data wasn't lost, so this commit will 'restore' lost data if you didn't save it again. I think the data is truly lost if you tried to save the broken pane, though.

Status: Fixed » Closed (fixed)

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