I did noting ,when try to clear cache I see this error Catchable fatal error: Object of class stdClass could not be converted to string includes/theme.inc on line 2742

foreach (array_keys($regions) as $region) {
    // Assign region to a region variable.
    $region_content = drupal_get_region_content($region);
//  $tmp = (array) $variables[$region];
//  if(empty($tmp))
    isset($variables[$region]) ? $variables[$region] .= $region_content : $variables[$region] = $region_content;

I google this error but didn't find anything, anybody know what is the reason of this error and how can I resolve it?

1 Answer 1


Clearing your cache goes through all of your code looking for hooks, so something you have installed or updated or written since the last time you cleared cache has this error.

The error technically means that you are trying to use the wrong type of variable in a particular function. In my limited experience, this usually means you have passed the wrong type of variable to the function before it.

In your case, it looks like you are trying to add a stdClass object $region_content to a string, which is why it is trying to convert it. You will likely need to dig into $region_content to find the markup you are looking for before adding it to your string.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.