I updated Ctools and Panels today from Panels 6.x-3.5 and Ctools 6.x-1.6.

After updating, if I visit /admin/build/mini-panels/list/header_panel/edit and then click on the link to edit the Content, I get the error message in the subject.

Regards,

Nigel

Comments

nigelcunningham’s picture

If I delete and recreate the mini-panel, I no longer get that error, so I get it's an upgrade issue.

Having said that, after recreating the minipanel and selecting Flexible for the layout, I get nothing of substance in the content tab. Would you like a separate issues for that? (I haven't yet checked if it's already reported).

merlinofchaos’s picture

Do you have a backup of the database? An export of the mini panel prior to deleting that could be very interesting.

I did *just* perform some architectural changes to the mini panels UI, so there could be some errors. A separate issue would be good.

nigelcunningham’s picture

I think I just got a -dev release at the wrong time.

I also just found that the clone a panel layout tab is also empty.

I don't have a backup of the minipanel, sorry. I could probably reproduce the issue, because I'm working on a local copy of my site, and I only rsync'd everything yesterday.

That said, how about if I do a CVS checkout of your latest and greatest and see if the issue is still there? Perhaps the dev release just got rolled at a bad point in your committing of changes.

merlinofchaos’s picture

I can't make this happen in my own testing. I've modified that code path just this morning, though, so maybe I fixed it without knowing this was a problem. Can you try latest CVS?

nigelcunningham’s picture

Status: Active » Closed (fixed)

I'm running CVS now without issues, so let's just call it transient and close it.

Thanks for your time!

nigelcunningham’s picture

Status: Closed (fixed) » Active
StatusFileSize
new56.11 KB

Hmm. I can still reproduce it.

Here's an 'export' of the panel I'm using.

$mini = new stdClass;
$mini->disabled = FALSE; /* Edit this to true to make a default mini disabled initially */
$mini->api_version = 1;
$mini->name = 'page_heading';
$mini->category = '';
$mini->title = 'Page Heading';
$mini->admin_description = '';
$mini->requiredcontexts = array();
$mini->contexts = array();
$mini->relationships = array();
$display = new panels_display;
$display->api_version = 1;
$display->layout = 'flexible';
$display->layout_settings = FALSE;
$display->panel_settings = FALSE;
$display->cache = FALSE;
$display->title = '';
$display->content = array();
$display->panels = array();
$display->hide_title = PANELS_TITLE_FIXED;
$display->title_pane = '0';
$mini->display = $display;

Steps to reproduce:
1) Create a new mini panel using the flexible format.
2) From the list of mini panels, click the 'Edit' item for your new panel.
3) Click on 'Content' in the bread crumb (is it a breadcrumb - it looks like one in the theme I'm hacking around!) and the error will appear.

I added a print_r($display) prior to that line, and will attach it as text.

nigelcunningham’s picture

Oooh. Looking through the cvs log just reminded me to say: I'm using Panels Everywhere. Perhaps that's significant.

merlinofchaos’s picture

Hmm, maybe it is. In my test site I have PE off on admin pages.

merlinofchaos’s picture

Status: Active » Fixed

Hm. No, that didn't make this happen for me either.

However, I guess I hadn't walked thorugh the 'add' mini panel process. I hadn't quite gotten that right.

I just checked in a fix to CVS. Panels you previously added probably won't work quite right, but older ones should be ok and newer ones I think will be fine.

nigelcunningham’s picture

Status: Fixed » Active

I'm afraid I'm still getting it after doing a CVS update. I'll try to get some more info.

nigelcunningham’s picture

I've found another way to reproduce it:

1) Create a new mini panel with the panany theme installed (not sure panany is significant, but I'm using one of its styles below).
2) Use the flexible layout style but don't worry about modifying the layout (it doesn't make a difference).
3) Seek to change the style for the 'Center' region to "Panany gradient background" and click next.
4) Regardless of whether you select to surround panes or panels, when you cliick the Save button, you get a popup error message:

Unable to complete operation. Fatal error in panels/plugins/display_renderers/panels_renderer_editor.class.php on line 1669: Function name must be a string

Hope that helps. I'll keep using xdebug to try and figure it out.

nigelcunningham’s picture

$style is empty.

merlinofchaos’s picture

Well, #11 is a different error message than the original, so I'm a little confused. Are these maybe two separate issues?

nigelcunningham’s picture

StatusFileSize
new121.43 KB
new127.01 KB

Maybe.

I've done some tracing, and found that the function gets called three times. It's only on the last time that it bombs out, by print_r'ing the $display array each time through (Xdebug's interactive examination of variables isn't working for me at the moment :<), I can see that the last time through $display is lacking a lot of info it has on the other calls - not just the renderer argument.

This makes me think that perhaps I didn't give you enough info about my layout for you to be able to reproduce the issue. I'm therefore attaching screenshots of my site template and front page layouts. Both the 'Left sidebar' and 'Page heading' areas in the site template use minipanels. The side bar is a simple column and the heading has two columns, one with just an image and the other with the site name and a suckerfish menu. (Not that I think the actual contents are important).

I'll see if I can use the backtrace to find out more.

merlinofchaos’s picture

Yes, giving me the results of a vsm_trace() when that $display is missing a bunch of data could be *very* helpful!

nigelcunningham’s picture

Is this good enough? I don't get a rendered page when the problem happens.

Fatal error: Call to undefined method stdClass::render() in /home/nigel/websites/crca-website/public_html/sites/all/modules/panels/panels.module on line 1014

Call Stack:
    0.0003     324688   1. {main}() /home/nigel/websites/crca-website/public_html/index.php:0
    1.5492   62430908   2. theme() /home/nigel/websites/crca-website/public_html/index.php:36
    1.5493   62446928   3. call_user_func_array() /home/nigel/websites/crca-website/public_html/includes/theme.inc:697
    1.5493   62447244   4. panels_everywhere_page_preprocess() /home/nigel/websites/crca-website/public_html/includes/theme.inc:0
    1.5619   62637444   5. ctools_context_handler_render() /home/nigel/websites/crca-website/public_html/sites/all/modules/panels_everywhere/panels_everywhere.module:171
    1.5720   62943720   6. panels_panel_context_render() /home/nigel/websites/crca-website/public_html/sites/all/modules/ctools/includes/context-task-handler.inc:46
    1.5771   63166448   7. panels_render_display() /home/nigel/websites/crca-website/public_html/sites/all/modules/panels/plugins/task_handlers/panel_context.inc:290
    1.5781   63210884   8. panels_display->render() /home/nigel/websites/crca-website/public_html/sites/all/modules/panels/panels.module:1014
    1.5801   63211208   9. panels_renderer_legacy->render() /home/nigel/websites/crca-website/public_html/sites/all/modules/panels/panels.module:686
    1.5801   63211208  10. panels_renderer_legacy->render_regions() /home/nigel/websites/crca-website/public_html/sites/all/modules/panels/plugins/display_renderers/panels_renderer_legacy.class.php:58
    1.5839   63212076  11. panels_renderer_legacy->render_pane() /home/nigel/websites/crca-website/public_html/sites/all/modules/panels/plugins/display_renderers/panels_renderer_legacy.class.php:106
    1.5840   63212328  12. ctools_content_render() /home/nigel/websites/crca-website/public_html/sites/all/modules/panels/plugins/display_renderers/panels_renderer_legacy.class.php:159
    1.5847   63212596  13. panels_mini_panels_mini_content_type_render() /home/nigel/websites/crca-website/public_html/sites/all/modules/ctools/includes/content.inc:269
    1.5850   63214612  14. panels_render_display() /home/nigel/websites/crca-website/public_html/sites/all/modules/panels/panels_mini/plugins/content_types/panels_mini.inc:106

Dump $_SERVER
   $_SERVER['REQUEST_METHOD'] = 'GET'
   $_SERVER['REQUEST_URI'] = '/admin/build/mini-panels/list/page_heading/edit/content'
   $_SERVER['HTTP_USER_AGENT'] = 'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.7) Gecko/20100715 Ubuntu/10.04 (lucid) Firefox/3.6.7'
Dump $_REQUEST
   $_REQUEST['q'] = 'admin/build/mini-panels/list/page_heading/edit/content'

Variables in local scope (#14):
  $display = *uninitialized*
  $form_context = *uninitialized*
  $renderer = *uninitialized*

Hmm. Funny that it says $display is completely uninitialised.

nigelcunningham’s picture

Status: Active » Needs review

I think I've found the problem.

panels_mini_load calls ctools_export_load_object with type 'names' prior to the render call and caches the result. When it's called for rendering, it thus returns just the result of the 'names' invocation, rather than the 'all' data that's needed.

Hope that makes sense :)

Changing 'names' to 'all' on line 136 of panels_mini.module makes it work for me.

By the way, I do still get that other error, so I'll start looking at it now.

merlinofchaos’s picture

Hm. That's weird, though, because there is a special check for $all_loaded in that caching to make sure that if just a small number of mini panels had previously been loaded, it will still load them all. I don't see how that can be getting short circuited.

nigelcunningham’s picture

I might just be ignorant, but are we looking at the same function? The $all_loaded check isn't in that caching - I'm looking in panels_mini_load and the only $all_loaded I can see is in panels_mini_load_all.

incaic’s picture

subscribing

merlinofchaos’s picture

Status: Needs review » Active

When it's called for rendering, it thus returns just the result of the 'names' invocation, rather than the 'all' data that's needed.

Your reference to the 'all' data made me think you were referring to panels_mini_load_all() -- since 'all' means, to ctools_export_load_object() to load all of them. It doesn't need to use 'all' to load just one export.

Also the 'needs review' status means that there is a patch attached.

nigelcunningham’s picture

Ah, sorry on both counts.

Hmm. So why does that make it start working? Guess I'll have to look some more!

mrlava’s picture

I'm getting

PHP Fatal error: Call to undefined method stdClass::render() in modules/panels/panels.module on line 1013

after I create a mini panel then try to edit the content of it at admin/build/mini-panels/list/(panel name)/edit/content
(it's a 3 column layout with views blocks as the content of each column)

nigelcunningham’s picture

Morning! :)

I've just updated, and this seems to be working for me now. Will double check when I get back from dropping the son off at school.

nigelcunningham’s picture

Yeah, it looks like it's working fine here. mrlava, would you confirm?

nigelcunningham’s picture

Ah... I was looking in the wrong place. Just hit it again :\

joecanti’s picture

Hi,

Just upgraded and get the same error message as #23. Whether it's part of the rest of this post I couldn't say but it looks similar... I notice it appears when going in to edit the content of a mini panel, but not when creating a new mini panel. Running panels 3.7 , panels everywhere 1.1 and ctools 1.7.

Will try the dev version later tonight.

Thanks, Joe

kundu’s picture

Well, I know it's not a def. solution, but at least i can edit my mini-panels again!!

what i did:

Went to panels.module and about line 1013, changed:

return $display->render($renderer);

by

if (method_exists($display, 'render')) { 
  return $display->render($renderer);
  }

And in panels_mini.module, about line 80 changed:

$block['subject'] = $panel_mini->display->get_title();

by

if (method_exists($display, 'get_title')) { 
    $block['subject'] = $panel_mini->display->get_title();
    }

and it works.

Don't ask me why..i'm just learning this stuff...drupal, php...etc...

maybe it also works if you comment that line, i didn't test it...

Cheers.

merlinofchaos’s picture

Ok, I discovered elsewhere that the reason I've had trouble seeing this is that it only occurs if the mini panel (any? Maybe just the one you're editing? Not sure) is also displayed on a block on the page.

That should help get more to the bottom of this.

mrlava’s picture

Correct, it is in a mini panel that is also in a block currently being displayed on the page, 3 column mini panel with a views block in each column.

nigelcunningham’s picture

I'm in that situation too - the one I'm editing is being displayed as well.

FreeFox’s picture

I have the same error and can confirm that if the mini-panel is visible on the site, you get the error. When I disable the block in context, the error is gone.

Hope this helps a little

pimok3000’s picture

Subscribe:

On the path "admin/build/mini-panels/list/sub_header_mini_pane"

i get the error:
Fatal error: Call to undefined method stdClass::render() in /var/www/sitename/sites/all/modules/panels/panels.module on line 1013

It is a 3 Column Mini-Panel 33/34/33

merlinofchaos’s picture

Status: Active » Needs review
StatusFileSize
new1.84 KB

This patch appears to fix this. Can I get a confirm?

I'm a little curious why I did it this way. I seem to recall having that line outside the if on purpose, but I can't seem to find anything this patch breaks.

merlinofchaos’s picture

StatusFileSize
new928 bytes

Whoops. Previous patch accidentally included another patch.

populist’s picture

I saw the same issue and the patch in #35 solved the problem.

FreeFox’s picture

I comfirm that the issue in #32 is solved by the patch.

Thanks a lot merlin

mrlava’s picture

Status: Needs review » Fixed

patch in #35 resolved the issue

merlinofchaos’s picture

Status: Fixed » Needs review

Not fixed until the patch is committed, lest I forget to actually commit it. =)

mrlava’s picture

Status: Needs review » Fixed

ah sorry, thanks for the help Earl! =)

mrlava’s picture

Status: Fixed » Needs review

doh, auto set it when i replied, sry =/

merlinofchaos’s picture

Status: Needs review » Fixed

Ok, committed! Now it's fixed. =)

nigelcunningham’s picture

Confirmed fixed here too. (Sorry for the delay in replying).

karma.code’s picture

Now all the mini-panels that I have exported out into code are not appearing in the mini panels UI. Anybody else having the problem?

febstarer’s picture

First lines of code in #28 fixed the issue for me, tho I understand it's not really a solution but more a workaround.
New patch didn't solve it (using panels 3.x-dev).
I'm not using mini-panels and I was getting the exact same error while executing cron with both version 3.7 and 3.x-dev (and related ctools version).

cheers =)

Status: Fixed » Closed (fixed)

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

jweberg’s picture

I'm getting this error when I try to edit a mini panel on the content tab only. The only difference is mine shows line 1013. I have uninstalled mini panels and reinstalled. Panels seems to be working fine.

Anonymous’s picture

Component: Code » Mini panels
Status: Closed (fixed) » Active

I was having the same error at line 1013. After upgrading to the latest Panels, Ctools and Panels Everywhere dev versions everything works, except I can't change layouts. I'm stuck with whatever I choose at creation.

BernieCram’s picture

upgrading to dev on Panels and CTools has also fixed the error at line 1013 problem for me. Thanks Merlin

zach harkey’s picture

Getting same result as Edith Illyes #48 - Can't ever change or modify layout after initial creation.

zach harkey’s picture

I have mini-panels working now and I can edit and save them without error.

I believe my problem was that I had upgraded panels and ctools to dev instead of trashing and downloading fresh copies.

In other words

$ cd sites/all/modules
$ rm -Rf panels ctools
$ drush dl panels-6.x-3.x-dev ctools-6.x-1.x-dev
$ drush updb

After this I recreated my mini-panels from scratch (although this may not have been necessary) and now I can edit them without getting the Call to undefined method stdClass::render() error (or any other errors).

lpalgarvio’s picture

hey

also the same, but like someone before said, in another line:
Fatal error: Call to undefined method stdClass::render() in /panels/panels.module on line 1013

panels 6.x-3.7

bryancasler’s picture

#35 fixed my problem

merlinofchaos’s picture

Status: Active » Closed (fixed)

#48 re-opened the issue but the issue has been fixed. There may be another issue, but given that we're past 50 comments, we definitely need that to be a new issue as it will be impossible to track here. Reverting status.

dawolle’s picture

"Fatal error: Call to undefined method stdClass::render() in /panels/panels.module on line 1013"

This comes up when i use my custome theme for adminpanel. when i edit a minipanel what is also displayed in a block at same moment i got this error,

this helps for me:

panels_mini.modile line 79:

$block['content'] = panels_render_display($panel_mini->display);
$block['subject'] = $panel_mini->display->get_title();

change to:

$methods = get_class_methods(get_class($panel_mini->display));

if(in_array('get_title', $methods)) {
$block['content'] = panels_render_display($panel_mini->display);
$block['subject'] = $panel_mini->display->get_title();
}

Hope it helps some one too :)