Jump to:

23368 Posts in 18143 Topics by 2863 members

General Questions

SilverStripe Forums » General Questions » Fatal error: Cannot use string offset [RESOLVED]

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Page: 1
Go to End
Author Topic: 1906 Views
  • Cem
    Avatar
    Community Member
    31 Posts

    Fatal error: Cannot use string offset [RESOLVED] Link to this post

    Hi I started getting this error:

    Fatal error: Cannot use string offset as an array in ../sapphire/core/i18n.php on line 1417
    Sounds like a translation thing
    I am using 2.3.3

    I can access nor main site neither admin.

    Any ideas to resolve the issue is appreciated.

    Thanks in advance

  • dalesaurus
    Avatar
    Community Member
    283 Posts

    Re: Fatal error: Cannot use string offset [RESOLVED] Link to this post

    Definitely is, something has hosed the SS global $lang. Are you setting it elsewhere, and have you checked that your translations files are intact?

  • Cem
    Avatar
    Community Member
    31 Posts

    Re: Fatal error: Cannot use string offset [RESOLVED] Link to this post

    Thanks for replying,
    I am setting it in the _config file as
    i18n::set_locale('tr_TR');
    i18n::set_default_lang('tr_TR');

    The interesting part is that everything works fine on my local machine but the same files do not work when
    I upload it to my hosting account.

    I even tried installing from scratch on my hosting account
    and even the install hangs with the same error.Weird...

    When I change the line in i18n.php on line 1417 from
    $transEntity = isset($lang[$locale][$class][$realEntity]) ? $lang[$locale][$class][$realEntity] : $string;
    to
    $transEntity =$string

    I can access the site but then translations do not work anymore.

    Bump...

  • Cem
    Avatar
    Community Member
    31 Posts

    Re: Fatal error: Cannot use string offset [RESOLVED] Link to this post

  • Futureweb
    Avatar
    Community Member
    232 Posts

    Re: Fatal error: Cannot use string offset [RESOLVED] Link to this post

    I just had the same problem, my locale was set to en_NZ. it has been working for a few weeks, and suddenly i was getting these php errors.

    changing to US fixed it on the public site, but the admin didn't work at all.
    after a while of frustration, I tried using firefox instead of chrome. and it worked prefectly.
    i shut down chrome, reopened- and, yes, all working

    so if you experience this problem and it's just started, try closing and reopening....

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