Hi
I just upgraded to:
* panels 6.x-3.7
* Views 6.x-2.11
* Chaos tool suite 6.x-1.7
* Views Bonus Pack 6.x-1.1

On updating I had the message - "Fatal error: Call to undefined function panels_render_layout() in ... sites/all/modules/panels/panels.module on line 1541"

Reverting to panels 6.x-3.5 fixed the error although I now have a warning "There are currently no style types available to add. You should enable a module that utilizes them, such as Panels." (Panels is in fact enabled)

CommentFileSizeAuthor
#15 panels-867340-15.patch1.68 KBcedarm
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

merlinofchaos’s picture

Hmm. That indicates you're using a module that's using panels_print_layout().

I note that the function seems to have been broken, and it's never used internally. Will see if I can fix this today.

alexkessler’s picture

I have the same error.
Views Bonus Pack is using panels_print_layout().
I already posted an issue on the Views Bonus Pack queue http://drupal.org/node/867046

jfpone’s picture

A temporary solution might be to re-introduce the panels_render_layout() function in panels/includes/display-render.inc.
I took the code from http://api.lullabot.com/panels_render_layout and it seems to work well with the Views Bonus Pack...
Here is the code :

panels/includes/display-render.inc, line 46

function panels_render_layout($layout, $content, $css_id = NULL, $settings = array(), $display = NULL) {
if (!empty($layout['css'])) {
if (file_exists(path_to_theme() . '/' . $layout['css'])) {
drupal_add_css(path_to_theme() . '/' . $layout['css']);
}
else {
drupal_add_css($layout['path'] . '/' . $layout['css']);
}
}
// This now comes after the CSS is added, because panels-within-panels must
// have their CSS added in the right order; inner content before outer content.

// If $content is an object, it's a $display and we have to render its panes.
if (is_object($content)) {
$display = $content;
if (empty($display->cache['method'])) {
$content = panels_render_panes($display);
}
else {
$cache = panels_get_cached_content($display, $display->args, $display->context);
if ($cache === FALSE) {
$cache = new panels_cache_object();
$cache->set_content(panels_render_panes($display));
panels_set_cached_content($cache, $display, $display->args, $display->context);
}
$content = $cache->content;
}
}

$output = theme($layout['theme'], check_plain($css_id), $content, $settings, $display);

return $output;
}

trilobite540’s picture

Hi, Yes that has worked for me. (I was using 3 column layout with views and they now function as expected)

hawkdrupal’s picture

Same problem, panels 3.7 broke most pages, error is "undefined function panels_render_layout()".

Restoring the the function seems to fix all the problems, which also included Domains module not displaying correct logos on page.

Perhaps a lot more use of this function than expected, better go through an official long-term deprecation process so everyone gets the heads-up.

merlinofchaos’s picture

Totally correct. Anyone want to create an actual patch for people?

panels_print_layout is already in a deprecated state. I'm not sure how panels_render_layout disappeared; it should've stayed in the same state. :(

droshani’s picture

I had the same issue which messed up whole web site, Then I went back to previous module releases and got back my web site, Now I still have a yellow box on all page which says

"There are currently no style types available to add. You should enable a module that utilizes them, such as Panels."

How can I remove this please?

merlinofchaos’s picture

Turn off the stylizer module in CTools

droshani’s picture

Thanks I did that, the warning disappeared, but as soon I updated my Dynamics Image View was messed up. This Theme was developed for me and do not know why the updated of module should mess up the front view.

merlinofchaos’s picture

#9: That is also irrelevant to this issue. In fact, so was #7 and I shouldn't have answered it here.

venusrising’s picture

We were using the frontpage view panels style 1 top two bottom. Does anyone know the correct way to get around this issue without hacking panels or downgrading. . Was not sure if applying #3 is okay or if it is considered a hack?

If we go to phpmyadmin and disable the view bonus pack we then get a page not found (we are using the views frontpage) if we then go in and change the plugin style unformatted to etc it works fine. We had a big issue with this View Bonus style on last upgrade too. Looks like the view bonus pack style needs to keep up with the panels API. I hope this feedback helps.

Thanks

venusrising’s picture

Also, regular panels pages are fine as long as stylizer is off, we did have to re-add the style but it is fine now

venusrising’s picture

Good Job jfpone , this works for me too! I am no php pro either
Thanks a ton!

captix’s picture

i got same problem

cedarm’s picture

FileSize
1.68 KB

In panels.module, panels_print_layout() still calls the non-existent panels_render_layout(), so here's an actual patch to restore it.

I noticed that in panels-6.x-3.5 panels_render_layout() is called by panels from two places, _panels_render_display() and panels_print_layout(). Do we need _panels_render_display() back? Probably not.

merlinofchaos’s picture

Status: Active » Fixed

Committed. I actually put this in panels.module in with the block of deprecated functions ot make it easier to identify and later removed.

If you are experiencing this problem, please do a grep on your codebase and see which module is using panels_print_layout() and make sure there is an issue in that module's queue. Panels 3.9 will have this function removed and Panels 3.8 will probably contain a warning to administrators that this function should no longer be in use.

cedarm’s picture

BTW, the comment on panels_render_display() should be updated.

mariagwyn’s picture

I updated to the dev version. Immediately, and error stating that "CTools is out of date...all panel modules disabled...see status update" appeared.

1. The status page gave no clue as to the problem.
2. All panels stopped working, even though the modules were not actually disabled.

This was solved by updating to ctools-dev version. However, this should be noted somewhere since it took me a bit to figure out that the updated version was asking for the dev version, not the most recent non-dev version.

I also ran a grep on my modules folder, and the only module using panels_print_layout is the views_bonus pack. i will post over there if it hasn't already been done.

update: posted in views_bonus issues. It was already there, but the conversation had stopped.
http://drupal.org/node/867046#comment-3321284

merlinofchaos’s picture

This was solved by updating to ctools-dev version. However, this should be noted somewhere since it took me a bit to figure out that the updated version was asking for the dev version, not the most recent non-dev version.

There's not much I can do about this. -dev versions are transitory. It knows that it wants an API version of CTools 1.8 -- and I try to keep the API versions in sync with CTools versions. Since CTools 1.8 hasn't been released, you have to guess that 1.8 means latest -dev. Since Panels cannot possibly know about CTools release data, we're already giving you the best information we can give.

mariagwyn’s picture

fair 'nuf

jessicakoh’s picture

Thank you, jfpone (#3).

It works.

plastikkposen’s picture

Same issue. Is there a permanent solution on its way?

merlinofchaos’s picture

The permanent solution is already in the -dev version.

Status: Fixed » Closed (fixed)

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