Jump to:

1374 Posts in 487 Topics by 520 members

Themes

SilverStripe Forums » Themes » PHP / Theme problem

Discuss SilverStripe Themes.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 317 Views
  • ThrashCardiom
    Avatar
    Community Member
    20 Posts

    PHP / Theme problem Link to this post

    I run Silverstripe 3.1.1 for a site with multiple themes. I use the code here: http://chillburn.com.au/blog/silverstripe-theme-changer/ to provide a tab to allow administrators to apply different themes to different areas of the site. It was all running well until this morning when cache files were removed from /tmp. Now when someone visits the site they get a blank page and I get the following error in the site log files:

    mod_fcgid: stderr: PHP Fatal error: Cannot use string offset as an array in /var/www/clients/client1/web2/web/framework/core/manifest/TemplateManifest.php on line 171

    I have no idea why this has started happening though obviously something necessary was cached. Can anyone provide any clues?

    thanks

  • ThrashCardiom
    Avatar
    Community Member
    20 Posts

    Re: PHP / Theme problem Link to this post

    I have a work around. I commented out lines :170 - 176 of TemplateManiftest.php and inserted a copy of line 173:

    169 /*********** commented out to fix theme problem - 2014/04/12
    170 if ($theme) {
    171 $this->templates[$name]['themes'][$theme][$type] = $pathname;
    172 } else if($projectFile) {
    173 $this->templates[$name][$this->project][$type] = $pathname;
    174 } else {
    175 $this->templates[$name][$type] = $pathname;
    176 }
    177 ************/
    178 $this->templates[$name][$this->project][$type] = $pathname;

    The site is now working at least. Is the cause likely to be an issue with coding change requirements between versions? I don't know enough about php or Silverstripe to track this down.

    317 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.