An error occurred at /admin/build/views/ajax/preview/admin_content.

Error Description:
Fatal error: Call to undefined function panels_print_layout() in /home/xxxx/html/sites/all/modules/views_bonus/panels/views_bonus_panels.module on line 20
Help please I don't what happened

Comments

sdboyer’s picture

For now, copy/paste this into your panels.module file:

function panels_print_layout($id, $content) {
  ctools_include('display-render', 'panels');
  ctools_include('plugins', 'panels');
  $layout = panels_get_layout($id);
  if (!$layout) {
    return;
  }

  return panels_render_layout($layout, $content);
}

Do not include the <?php or ?> tags.

We will figure out a better, more permanent solution shortly.

michelle’s picture

Title: Can Longer Access Views or Frontpage-new update » Fatal error: Call to undefined function panels_print_layout()
Project: Views (for Drupal 7) » Panels
Version: 6.x-2.10 » 6.x-3.4
Component: Views Data » Code
Assigned: Unassigned » sdboyer

Thanks, sdboyer. I took a risky chance and upgraded my live site without testing first and ouch! I do have a backup but this works much nicer than reverting to the insecure version. :)

Michelle

joshua.stout’s picture

Thanks! This fixed the error for me as well. Great timing!

venusrising’s picture

I decided to roll back Ctools and panels until this is fixed. Is this an okay solution instead of hacking the module file? Since Ctools and Panels work in tandem it seems Ctools needs to be sorted out prior to moving forward What are your thoughts?

planstoprosper’s picture

Thank you! This seems to fix the error just fine for me.

jessicakoh’s picture

Thank you, sdboyer.

W.M.’s picture

I get a similar error but with "panels_load_include()":

Fatal error: Call to undefined function panels_load_include() in home/000/public_html/sites/all/modules/views_bonus/panels/views_bonus_panels.module on line 18

What change, as in #1, I need to make to "panels.module" to solve this issue?!

Note: I have latest dev versions of Panels & Ctools downloaded yesterday.

gozigzag’s picture

I'm not sure what's going on...the first time I tried the fix in #1 it worked fine and displayed my views_bonus_pack panels normally. But, I wanted to retest before putting it on my live server. And now I cannot get my views_bonus_pack panels to display. I upgrade to Panels 6.x-3.4, then add the patch in #1, and it no longer displays any errors, but simply does not display my views on the page.

gozigzag’s picture

problem solved- I just had not upgraded ctools yet, where I had the 1st time. Fix in #1 seems to be working now.

Ole Martin’s picture

I have updated all modules and is then received this error. I copied the code at the end of "panels.module", but now receive this error: Parse error: syntax error, unexpected '<' in /home/xxxxx/public_html/xxxxx/sites/all/modules/panels/panels.module on line 1047
What can I do about this?

merlinofchaos’s picture

When pasting the code, do not include the <?php or ?> tags.

Ole Martin’s picture

I did, but still errors.

merlinofchaos’s picture

Well, the error you got suggests there is a stray < at the line that it mentions. It's hard to tell what you actually did, but my guess is cut & paste error.

Ole Martin’s picture

I delete everything and started from the start again, and now it seems to work well. But I having trouble entering blocks in Panels. It stands and loads and loads, until I re-load the page. Then I can see the block and save it. All other things seem to be working fine.
Thank you for your help.

merlinofchaos’s picture

sdboyer’s picture

Status: Active » Fixed

OK, the function has been restored in panels.module (though it's been marked deprecated), so this'll be included in the patchup release I'm making presently.

hawkdrupal’s picture

I had the same problem, took down most of my site. My fix was to revert to Panels 3.3.

It seems this function can't be deprecated since other modules (presumably Views) rely on it.

Status: Fixed » Closed (fixed)

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