Jump to:

1369 Posts in 487 Topics by 520 members

Themes

SilverStripe Forums » Themes » [SOLVED] Cannot change my theme SS3.1

Discuss SilverStripe Themes.

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

Page: 1
Go to End
Author Topic: 688 Views
  • jaaf
    Avatar
    Community Member
    24 Posts

    [SOLVED] Cannot change my theme SS3.1 Link to this post

    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.

  • thomas.paulson
    Avatar
    Community Member
    67 Posts

    Re: [SOLVED] Cannot change my theme SS3.1 Link to this post

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

  • jaaf
    Avatar
    Community Member
    24 Posts

    Re: [SOLVED] Cannot change my theme SS3.1 Link to this post

    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.

  • thomas.paulson
    Avatar
    Community Member
    67 Posts

    Re: [SOLVED] Cannot change my theme SS3.1 Link to this post

    Hello Jaaf

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

    I hope it works

  • jaaf
    Avatar
    Community Member
    24 Posts

    Re: [SOLVED] Cannot change my theme SS3.1 Link to this post

    I did it

  • Tim Snadden
    Avatar
    Community Member
    32 Posts

    Re: [SOLVED] Cannot change my theme SS3.1 Link to this post

    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.

    688 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.