By techypaul on
Hi,
in_array() [<a href='function.in-array'>function.in-array</a>]: Wrong datatype for second argument in /var/www/includes/common.inc(1655) : eval()'d code on line 9.
My logs are littered with this same message. I have no idea what it means. When I visit the common.inc file, I see this module:
function drupal_eval($code) {
global $theme_path, $theme_info, $conf;
// Store current theme path.
$old_theme_path = $theme_path;
// Restore theme_path to the theme, as long as drupal_eval() executes,
// so code evaluted will not see the caller module as the current theme.
// If theme info is not initialized get the path from theme_default.
if (!isset($theme_info)) {
$theme_path = drupal_get_path('theme', $conf['theme_default']);
}
else {
$theme_path = dirname($theme_info->filename);
}
ob_start();
print eval('? >'. $code); //added space for forum display
$output = ob_get_contents();
ob_end_clean();
// Recover original theme path.
$theme_path = $old_theme_path;
return $output;
}
It points to the Print eval line. Does anyone know when and why this is called? If I understand that I might be able to work backwards.
Thanks,
Paul.
Comments
.
You have some code that is being evaluated that has an error in it. Like when you put code into a block or a node using the php input format. It would be line 9 of that code that's broken.
Michelle
Thanks!
Thanks michelle, thats really great - I discovered it was a mistake in my menu converting from nid to clean url. All fixed now.
Thanks,
Paul.
p.s. as you're reading, just a quick thanks for the advanced forum, a very useful module :).
Just wanted to update this -
Just wanted to update this - it wasnt what I first thought. I continued to get errors. I started removing all code from my front page (literally) and was still getting the error. I realized it was only coming from the Admin user, so I cleared the Admin Menu module cache and suddenly it is all working again, so maybe a uninstall or disabled module left something.
Thanks for the help.
Paul.
.
Glad you got it working. :)
Michelle
Hi, I thought I had this
Hi,
I thought I had this licked, but its still coming up. I cleared my entire page tpl and ran it, so there is nothing coming up when I refresh but the error is still appearing. There are no blocks on that page, only views and the static html that I have removed. I assume views wouldnt run because its not being called in the template.
Any idea what drupal runs through, even if not being displayed/used?
Thanks,
Paul.
Notice: Undefined offset: 8192 in C:\wamp\www\Drupal\includes\co
How do I resolve this?
It was code in a block that caused it for me
Thanks for the hint Michelle. I started getting the error message:
warning: in_array() [function.in-array]: Wrong datatype for second argument in /var/www/theme/includes/common.inc(1685) : eval()'d code on line 3.It showed up three times on certain pages and only one time on others. It turned out I had forgotten to qualify when to execute a check of when to show a block, using php. This was being run on every page now:
...the error came because arg(1), which the 'user_load' object needs, only exists on user pages, where the path alias is users/'username', and the "real" path is for example user/66. Checking that a user page is being viewed fixed the problem:
Still getting this error.
Still getting this error. Been through every block and there is no PHP at all anymore and its still coming up, I have this backtrace;
This happens when there are no blocks actually selected for that page (e.g. a page with no regions, html coded). Would blocks be run through in that situation?
Thanks,
Paul.