After uploading custom logo image site doesn't work at all, just displays the following error:

Fatal error: [] operator not supported for strings in C:\xampp\htdocs\drupal\includes\common.inc on line 2313

Comments

Ivo.Radulovski’s picture

Status: Active » Fixed

this is something that comes from the original OpenPublic theme and was taken into the theme here.

Please have a look at http://drupal.org/node/1087338

Change your file to logo.png or use this to fix the problem:

change the template.php:

$site_name = $variables['site_name'];
   if (preg_match("|^.*/files/(.*)|", $logo, $m)) {
     $file = "public://" . $m[1];
-    $header_logo = l(theme('image_style', array('style_name'=>'logo', 'path'=>$file, 'alt'=>"$site_name logo")), $frontpage, array("html"=>TRUE, 'attributes'=>array('class'=>'logo')));
-    $footer_logo = l(theme('image_style', array('style_name'=>'logo-small', 'path'=>$file, 'alt'=>"$site_name logo")), $frontpage, array("html"=>TRUE, 'attributes'=>array('class'=>'logo')));
+    $header_logo = l(theme('image_style', array('style_name'=>'logo', 'path'=>$file, 'alt'=>"$site_name logo")), '', array("html"=>TRUE, 'attributes'=>array('class'=>'logo')));
+    $footer_logo = l(theme('image_style', array('style_name'=>'logo-small', 'path'=>$file, 'alt'=>"$site_name logo")), '', array("html"=>TRUE, 'attributes'=>array('class'=>'logo')));
   }
   elseif ($logo == url(drupal_get_path('theme', 'openpublic_eu') . "/logo.png", array('absolute'=>TRUE))) {
     $header_logo = l(theme('image', array('path'=>$logo, 'alt'=>"$site_name logo")), '', array("html"=>TRUE, 'attributes'=>array('class'=>'logo')));

We will update the theme soon.

Thanks,
Ivo

samardel’s picture

Status: Fixed » Active

thanks..

I am facing one more problem, should I create a new issue for it or you will consider it here?
Issue is: newly created main menu items don't display at all but changing the theme to default (Bartik 7.0) or something else, they appear properly.

Ivo.Radulovski’s picture

Status: Active » Patch (to be ported)
rhia05’s picture

I have modified the template.php and changed the file name to logo.png and my site breaks still when trying to change the logo.

tomdavidson’s picture

I still get the fatal error when using "logo.png", but the patch at http://drupal.org/node/1087338#comment-4245242 appears to do the trick for me.

br, tom

mmartinov’s picture

Status: Patch (to be ported) » Fixed

I've just applied the patch from the previous comment.

Status: Fixed » Closed (fixed)

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