Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Themes /

Discuss SilverStripe Themes.

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

PHP / Theme problem


Reply


2 Posts   479 Views

Avatar
ThrashCardiom

Community Member, 20 Posts

13 April 2014 at 6:37pm

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

Avatar
ThrashCardiom

Community Member, 20 Posts

14 April 2014 at 11:19am

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.