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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Themes /

Discuss SilverStripe Themes.

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

[SOLVED] Cannot change my theme SS3.1


Go to End


7 Posts   4435 Views

Avatar
jaaf

Community Member, 24 Posts

12 February 2014 at 6:24am

Edited: 12/02/2014 6:25am

Hi,

I have my site hosted on a shared hosting

I tried to change theme doing the following way

Prepared a "perso" theme on a local site
Once the theme was ready
I put it into the theme directory on the remote server.
I changed the name of the theme in mysite/_config/config.yml
and the file was changed to the following.

Name: mysite
After: 'framework/*','cms/*'
---
# YAML configuration for SilverStripe
# See http://doc.silverstripe.org/framework/en/topics/configuration
# Caution: Indentation through two spaces, not tabs
SSViewer:
  theme: 'perso'

Then I visited zoraldia.com/?flush=1

The adress in the browser's adress bar turned to this

www.zoraldia.com/?flush=1&flushtoken=31bec36a058a8194b2058ca414d71016

And I get the following message

in a blue bar

[Warning] is_readable() [function.is-readable]: open_basedir restriction in effect. File(/usr/share/php/Zend/Translate/Adapter/I18nRailsYamlAdapter.php) is not within the allowed path(s): (/htdocs:/var/www/zoraldia.com/htdocs:/var/www/zoraldia.com/tmp:/var/www/zoraldia.com/exec_dir:/var/www/zoraldia.com/php-session:/var/lib/lws/:/usr/base/var/lib/lws:/htdocs:/tmp:/exec_dir:/php-session:/usr/share/php)
GET /?flush=1&flushtoken=31bec36a058a8194b2058ca414d71016
Line 198 in /htdocs/framework/thirdparty/Zend/Loader.php

then
Source
189 
190         foreach (self::explodeIncludePath() as $path) {
191             if ($path == '.') {
192                 if (is_readable($filename)) {
193                     return true;
194                 }
195                 continue;
196             }
197             $file = $path . '/' . $filename;
198             if (is_readable($file)) {
199                 return true;
200             }
201         }
202         return false;
203     }
204 
Trace
is_readable(/usr/share/php/Zend/Translate/Adapter/I18nRailsYamlAdapter.php) 
Loader.php:198
Zend_Loader::isReadable(Zend/Translate/Adapter/I18nRailsYamlAdapter.php) 
Translate.php:126
Zend_Translate->setAdapter(Array) 
Translate.php:93
Zend_Translate->__construct(Array) 
i18n.php:2121
i18n::get_translators() 
i18n.php:2026
i18n::_t(SecurityAdmin.NEWGROUP,New Group,,) 
Core.php:167
_t(SecurityAdmin.NEWGROUP,New Group) 
Group.php:40
Group->populateDefaults() 
DataObject.php:424
DataObject->__construct() 
ReflectionClass->newInstance() 
InjectionCreator.php:24
InjectionCreator->create(Group,Array) 
Injector.php:491
Injector->instantiate(Array,Group) 
Injector.php:797
Injector->get(Group) 
Core.php:155
singleton(Group) 
Security.php:909
Security::database_is_ready() 
Controller.php:75
Controller->init() 
RootURLController.php:117
RootURLController->handleRequest(SS_HTTPRequest,DataModel) 
Director.php:360
Director::handleRequest(SS_HTTPRequest,Session,DataModel) 
Director.php:152
Director::direct(/,DataModel) 
main.php:189

If I just remove the leading www. I can see my site without the message but the theme remains alway the initial one (simple).

I don't see what to do in order to change my theme.

Thank you for help.

Avatar
thomas.paulson

Community Member, 107 Posts

12 February 2014 at 4:30pm

try remove entry from mysite/_config/config.yml.
Change theme using admin->setting

Avatar
jaaf

Community Member, 24 Posts

12 February 2014 at 7:15pm

Hi Thomas, thank you.

Before reading your mail I tried my theme just renaming it simple.

But now, after, putting things in their original state, It works from the backend settings (I can change the theme). I have just a warning appearing

Warning: Invalid argument supplied for foreach() in /htdocs/framework/core/manifest/ConfigManifest.php on line 655

but the renderring is ok.

Avatar
thomas.paulson

Community Member, 107 Posts

12 February 2014 at 7:56pm

Hello Jaaf

make sure to remove 'theme' entry from mysite/_config/config.yml.

I hope it works

Avatar
jaaf

Community Member, 24 Posts

12 February 2014 at 10:40pm

I did it

Avatar
Tim Snadden

Community Member, 32 Posts

15 May 2014 at 7:55am

Edited: 15/05/2014 7:57am

YAML is whitespace sensitive. So 'theme' needs to be indented 2 spaces. You may have done this already. I tried to demo it using a code block here but it seemed to stripe the whitespace.

Also, when setting config via YAML you need to make sure to flush for it to take effect.

Avatar
WorkAnon

Community Member, 1 Post

7 July 2017 at 3:09am

@Tim Snadden: Thanks for the white-space YAML sensitivity info. This was driving me round in circles for hours, when I came across this. The tutorials don't warn you of this!