In my views section for the fullcalendar, as well when I click the calendar link, I am getting the following errors:

    Warning: Invalid argument supplied for foreach() in element_children() (line 6134 of /data/12/1/33/48/1196048/user/1274238/htdocs/tcsite/includes/common.inc).
    Warning: Cannot use a scalar value as an array in drupal_render() (line 5622 of /data/12/1/33/48/1196048/user/1274238/htdocs/tcsite/includes/common.inc).
    Warning: Cannot use a scalar value as an array in drupal_render() (line 5677 of /data/12/1/33/48/1196048/user/1274238/htdocs/tcsite/includes/common.inc).
    Warning: Invalid argument supplied for foreach() in element_children() (line 6134 of /data/12/1/33/48/1196048/user/1274238/htdocs/tcsite/includes/common.inc).
    Warning: Cannot use a scalar value as an array in drupal_render() (line 5622 of /data/12/1/33/48/1196048/user/1274238/htdocs/tcsite/includes/common.inc).
    Warning: Cannot use a scalar value as an array in drupal_render() (line 5677 of /data/12/1/33/48/1196048/user/1274238/htdocs/tcsite/includes/common.inc).

Is this a calendar issue or views?? What could be causing this error?

CommentFileSizeAuthor
#15 Fullcalendar-screen.png74.31 KBpkchoo
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

aspilicious’s picture

Views and ctools version?

breeze76’s picture

I have both modules installed, but this error is in the views section when doing the settings for the calendar.

aspilicious’s picture

Yeah I know you installed both but what is the current version of those modules that you're using? alpha? beta? release candidate?

breeze76’s picture

ctools: 7.x-1.x-dev
views: 7.x-3.x-dev

blasthaus’s picture

stumbled upon this post, but you may try to insert this debug code before line 6134 inside the element_children function in common.inc
to see what is calling the function


/* attempt to trace the error */

if (!is_array($elements) && function_exists('views_trace')) {
    dsm(views_trace());
}

I might note that i resolved a similar issue with this function while in a Views admin screen and traced it to my own code.

A side note to that is if you are using an admin theme with no 'node.tpl.php' file, Drupal will pull that out of /modules/node
and in a few cases there are render statements there without any conditional, so if you are altering values in places like links
or comments, you should be aware of that.

breeze76’s picture

I tried inserting the code above, but get an error on it... here is the error:

Fatal error: Call to undefined function dsm() in /data/12/1/33/48/1196048/user/1274238/htdocs/tcsite/includes/common.inc on line 6138

Line 6138 is: dsm(views_trace());

Anything else?? I appreciate your help... This is one of the last two issues I need to get fixed...

tim.plunkett’s picture

@breeze76: dsm is from devel.module. If you're debugging a module, it is indispensible, which is why @blasthaus assumed you had it.

breeze76’s picture

OK.. so, such I install it in order to try to debug this issue?

aspilicious’s picture

Yes

breeze76’s picture

OK install the devel module and get this info:

    common.inc: element_children line 5617
    common.inc: drupal_render line 5634
    common.inc: drupal_render line 5634
    views_handler_field.inc: drupal_render line 951
    theme.inc: views_handler_field->advanced_render line 316
    theme.inc: template_preprocess_views_view_field line 858
    views_handler_field.inc: theme line 1288
    views_plugin_style.inc: views_handler_field->theme line 316
    views_plugin_style.inc: views_plugin_style->render_fields line 274
    views_plugin_style.inc: views_plugin_style->render_grouping line 232
    theme.inc: views_plugin_style->render line 45
    theme.inc: template_preprocess_views_view line 858
    views_plugin_display.inc: theme line 2384
    view.inc: views_plugin_display->render line 1022
    views_plugin_display_page.inc: view->render line 219
    view.inc: views_plugin_display_page->execute line 1085
    views.module: view->execute_display line 461
    menu.inc: call_user_func_array line 503
    index.php: menu_execute_active_handler line 21

Error message

    Warning: Invalid argument supplied for foreach() in element_children() (line 6140 of /data/12/1/33/48/1196048/user/1274238/htdocs/tcsite/includes/common.inc).
    Warning: Cannot use a scalar value as an array in drupal_render() (line 5622 of /data/12/1/33/48/1196048/user/1274238/htdocs/tcsite/includes/common.inc).
    Warning: Cannot use a scalar value as an array in drupal_render() (line 5677 of /data/12/1/33/48/1196048/user/1274238/htdocs/tcsite/includes/common.inc).

The first part is displayed over and over as well as the second part.. I am not sure what I am looking at... any help please...

aspilicious’s picture

Can you try latest fullcalendar dev code? (it needs the "colors module" and update.php to upgrade)

tim.plunkett’s picture

Version: 7.x-2.0-alpha6 » 7.x-2.x-dev
Status: Active » Postponed (maintainer needs more info)
breeze76’s picture

I added the color module and updated to the latest dev version and ran update.php, still get the same error....

aspilicious’s picture

ARe you still struggeling with this :s

pkchoo’s picture

FileSize
74.31 KB

I'm actually experiencing this issue and I updated to the latest dev version 7.x-2.x-dev and ran update.php... no luck. I am currently working on the site locally so I can't show it yet. Any ideas on how this could be remedied?

Thank you,
Joe

itismejoshy’s picture

same issue here.....stumped...

tim.plunkett’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)

If someone can provide steps to reproduce, please reopen.

Urza9814’s picture

I'm having the exact same bug. Empty drupal install, put in several modules, but I currently have ctools 7.x-1.0-rc1, date 7.x-2.0-rc1 and FullCalendar 7.x-2.0-beta2

Interestingly, I wasn't able to set up fullcalendar as described in the docs -- When I go to add a date object to the view field, there isn't any. So instead I added the google calendar module, and added the following calendar:
https://www.google.com/calendar/feeds/spark.progress%40gmail.com/public/...

The events on the calendar show up fine, but I get the same series of error messages.

For right now, I went into views_handler_field.inc (in modules/views/handlers) and added the following code to the very top of 'function advanced_render($values)', right at line 948:

    if(!is_array($values))
      return;

That's stopped the errors, and I'm not noticing any issues with it...though I realize it's a rather poor fix, and I should really be following that $values array all the way up to see WHY it's created as the value '1' sometimes rather than an array...

aspilicious’s picture

Status: Closed (cannot reproduce) » Active

Marking active again. Probably caused by the gcal handling.

Btw: you can't find any date fields if you didn't create one. You should add one first to the content type you would like to show.

Urza9814’s picture

Just a note for anyone else dealing with this: I've discovered that the solution I posted above screws up other parts of the views module. A better alternative is just to insert the return at line 5597 of includes/common.inc -- so you end up with:

[code]
function drupal_render(&$elements) {
if(!is_array($elements))
return;
[/code]

aspilicious’s picture

The new ajax patch is going to fix this. It's under development these days so be patient :) and you'll be rewarded.

tim.plunkett’s picture

Status: Active » Postponed

Postponing this on the contextual filters patch. We'll see if this still is a problem after that.

assolsv’s picture

I have the issue as well

  • Drupal 7.12
  • FullCalendar 7.x-2.0-beta3
  • Views 7.x-3.0-rc3

Notice : Undefined index: grouping dans views_plugin_style->render() (ligne 232 dans /var/<removed>/httpdocs/sites/all/modules/views/plugins/views_plugin_style.inc).

Not sure it's related though... Maybe a version mismatch between Views and FullCalendar? If so, how can I fix this?

Thanks a lot and best regards.

tim.plunkett’s picture

@assolsv Views is now stable, you should definitely update.

assolsv’s picture

Tim,

You mean to 7.x-3.1 ?
I did a modules update check and it's not suggested... Trying to (force) install http://ftp.drupal.org/files/projects/views-7.x-3.1.tar.gz doesn't work and it states that Views is already installed.

Shall I de-install Views and install the latest ?

Thanks and best regards-

assolsv’s picture

Just an update to my previous post.

Actually, today I checked for updates on my Drupal site and Views was showing in the list of modules to update (it was not the case last week). Maybe some dependencies issues were addressed meanwhile?
Anyway, now after update my Views is at 7.x-3.1 and it fixed the issue.
All fine.

Thanks a lot!

tim.plunkett’s picture

Status: Postponed » Fixed

Glad to hear it!

Status: Fixed » Closed (fixed)

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