Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 327 Vote(s) - 3.5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Illegal string offset '#children' in drupal_render()

#1
My full calendar throws errors when seen from the site:

> Warning: Invalid argument supplied for foreach() in element_children() (regel 6400 van C:\Users\Simon\My Websites\Xampp\htdocs\xxx\includes\common.inc).
Warning: Illegal string offset '#children' in drupal_render() (regel 5867 van C:\Users\Simon\My Websites\Xampp\htdocs\xxx\includes\common.inc).
Warning: Illegal string offset '#children' in drupal_render() (regel 5877 van C:\Users\Simon\My Websites\Xampp\htdocs\xxx\includes\common.inc).
Warning: Illegal string offset '#children' in drupal_render() (regel 5915 van C:\Users\Simon\My Websites\Xampp\htdocs\xxx\includes\common.inc).
Warning: Illegal string offset '#printed' in drupal_render() (regel 5922 van C:\Users\Simon\My Websites\Xampp\htdocs\xxx\includes\common.inc).

I have read somewhere that it doesn't work well under PHP 5.4xx.

Anyone a solution?
Reply

#2
It looks like you are trying to render elements that does not have the proper array layout. Try to use `debug_backtrace()` and `debug_print_backtrace()` to find the code that is causing the warnings.

Also you can also uninstall modules and see when the error does away. Be sure to clear your cache to be sure you are not fooled by anything.

Other commands you can use is `dd()` `dpm()` `krumo()` from the devel-module.

Also look at: [

[To see links please register here]

][1] and [

[To see links please register here]

][2]

David


[1]:

[To see links please register here]

[2]:

[To see links please register here]

Reply

#3
This is a known issue with PHP/Drupal. All the errors that you see are *not* errors, they're just warnings and can be very safely ignored. You only need to be concerned with lines that start with `Error: ....`.

To safely ignore these warnings, edit your drupal `sites/default/settings.php` and add the following line:

error_reporting(E_ALL & ~(E_STRICT|E_NOTICE|E_WARNING));

This will also resolve the same issue for potentially other plugins too.

The recommended production setting for Drupal is to disable error reporting altogether, so that your users don't get any cryptic error messages. For a production Drupal site, you must do:

error_reporting(0);

And if you need to see errors in your website, use the nginx logs instead.

Edit: Fix error_reporting, add production notes
Reply

#4
I was getting tons of similar warnings with Drupal 7.23 and PHP 5.4, especially from Panels. I just changed the PHP version from 5.4 to 5.3 (single php.ini) in the cPanel/PHP Config and all these warnings and notes disappeared.
Reply

#5
Better advice is as follows:

1) To hide warnings/errors/notices from users on a live Drupal 7 site, go to [SITE]/admin/config/development/logging and turn off the display of errors. Don't do it in your settings file, as you then lose the ability to find problems.

2) It is often worthwhile to do a bit of debugging. While it is true that, as a general matter, warnings and notices can be safely ignored, they will slow down your site ( see

[To see links please register here]

). Often the error is the result of a known problem with a particular Drupal module, and there may be a patch posted on drupal.org that fixes the problem. The source of this particular (and common) bug can be difficult to track down, but there's a helpful discussion for how to do it here:

[To see links please register here]


In your case, it's probably a bug in the Calendar module (assuming that's what you're using to produce your calendar), and you probably want to look at the issue queue there:

[To see links please register here]

Reply

#6
Whether it helps I don't know,
but I had a similar error message, it was due to me changing the machine name of a content type....
I reverted to the previous backup, which had the content type altered as well, deleted it, recreated it with the intended name and all is good
Reply

#7
**Related issue:** in module commons_events, equivalent error messages were triggered by a migration from PHP 5.3 to 5.4 and fixed in [#1995834][1]: PHP 5.4 Attend an Event page errors to screen in comment **#13**.


[1]:

[To see links please register here]

Reply

#8
Adding this patch to the common.inc helped me fix my problems

diff --git a/includes/common.inc b/includes/common.inc
index c6303ef..e8f7e66 100644
--- a/includes/common.inc
+++ b/includes/common.inc
@@ -6007,7 +6007,9 @@ function drupal_render(&$elements) {
// for speed.
if ($elements['#children'] == '') {
foreach ($children as $key) {
- $elements['#children'] .= drupal_render($elements[$key]);
+ if (is_array($elements[$key])) {
+ $elements['#children'] .= drupal_render($elements[$key]);
+ }
}
}
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through