2 replies [Last post]
@eminkel's picture
Offline
Joined: 06/27/2009
Juice: 29
Was this information Helpful?

* recoverable fatal error: Object of class stdClass could not be converted to string in /home/sites/all/themes/orange/template.php on line 212.
* recoverable fatal error: Object of class stdClass could not be converted to string in /home/sites/all/themes/orange/template.php on line 212.
* recoverable fatal error: Object of class stdClass could not be converted to string in /home/sites/all/themes/orange/template.php on line 212.
* recoverable fatal error: Object of class stdClass could not be converted to string in /home/sites/all/themes/orange/template.php on line 212.

One for each attribute for the product.

Function for Line 212 reads (212 is bold):

function orange_render_attributes($attributes) {
if ($attributes) {
$items = array();
foreach ($attributes as $attribute => $data) {
if (is_array($data)) {
$data = implode(' ', $data);
}
$items[] = $attribute .'="'. $data .'"';
}
$output = ' '. str_replace('_', '-', implode(' ', $items));
}
return $output;
}

I'm assuming this is a template issue. I am using the template Orange. Please halp!

@eminkel's picture
Offline
Joined: 06/27/2009
Juice: 29
Re: Error while using Attributes

If anyone else comes across this issue here is the fix:

Replace like 212 with:

if (is_string($data)) {
$items[] = $attribute .'="'. $data .'"';
}

This deals with using the Orange theme www.drupal.org/project/orange

LuckySMack's picture
Offline
Joined: 04/13/2008
Juice: 56
Wow

This fix couldnt be more specific, I have the same error and im using Orange. Seemed to work and thanks.