Jump to:

324 Posts in 153 Topics by 156 members

Migrating a Site to Silverstripe

SilverStripe Forums » Migrating a Site to Silverstripe » Major Admin Interface issues after server migration

What you need to know when migrating your existing site to SilverStripe.

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

Page: 1
Go to End
Author Topic: 2712 Views
  • atretes
    Avatar
    Community Member
    2 Posts

    Major Admin Interface issues after server migration Link to this post

    Hi All

    This might be one for the gurus... I am currently developing a site from scratch using the latest v2.3.2-beta1 version of SilverStripe. Why? Because the web site needs to be completely multilingual, en_US and af_ZA. I have two modules that are included, the blog module and image gallery module and I have created a custom theme for the site and modules. Now all works beautifully on my local development server, running XAMPP 2.5, but then I migrate the site to our Hetzner host and put the site in a staging directory and edit the .htaccess file to make sure the RewriteBase is correct.

    I run into two snags, the first is that I got the following error:

    Fatal error: Cannot use string offset as an array in /usr/www/site/staging/sapphire/core/i18n.php on line 1417

    This comes from the _t() function and seems to be something to do with PHP5. I did a lot of hunting to figure out why this error is occurring and managed to fixed the problem with the following code:

    if(isset($lang[$locale]))
    {
    if(isset($lang[$locale][$class]))
    {
    if(isset($lang[$locale][$class][$realEntity]))
    $transEntity = $lang[$locale][$class][$realEntity];
    else
    $transEntity = $string;
    } else
    $transEntity = $string;
    } else
    $transEntity = $string;

    Now I'm able to get access to the SilverStripe admin interface but what I notice is that the after the interface is completely loaded and I try creating a new page, or doing anything else, the interface just completely 'hangs' (if I can call it that). I check in Firebug and the AJAX requests are sent successfully and return successfully with the correct update code. I even went as far as doing a Diff on the exact same AJAX response from my local development server and the production server and all looked good, but still the admin interface is not being refreshed.

    I then check, in Firebug, to see if all the .js files are loaded properly, all seems to be fine. The only difference that I could spot is that on the production server the admin interface is doing the following request:

    which fails! This is the only lead that I have to the problem, does anybody perhaps know what might be causing this sort of thing?

    I thank you in advance for your input.

  • Ingo
    Avatar
    Forum Moderator
    801 Posts

    Re: Major Admin Interface issues after server migration Link to this post

    > GET http://www.site.org/staging/cms/javascript/LangSelect
    I'm assuming that this URL was truncated by the forum? It should be:
    http://www.site.org/staging/cms/javascript/LangSelector.js

    > Now all works beautifully on my local development server, running XAMPP 2.5, but then I migrate the site to our Hetzner host
    What PHP version do you have at Hetzner? Would you be able to post relevant parts of your phpinfo()?

    > Fatal error: Cannot use string offset as an array in /usr/www/site/staging/sapphire/core/i18n.php on line 1417
    In which language are you displaying the backend? Could you try to find out the values of all the following variables on the failing call? $locale, $class, $realEntity

  • patrik
    Avatar
    Community Member
    9 Posts

    Re: Major Admin Interface issues after server migration Link to this post

    I also have the silverstripe
    Fatal error: Cannot use string offset as an array in <x> i18n.php, error

    I have managed to figure out that the $lang variable, which is a global array from the language file, is overwritten with the string "en" somewhere in the code...
    I can solve it by placing       
    unset($lang);
    $lang=array();
    require_once("C:/docroot/mysite/site/lang/en_US.php");

    in the _t function. But thats not nice at all. Anyone knows where that variable could be overwritten?

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