Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » i18n multilingual site: MySQL error

Our old forums are still available as a read-only archive.

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

Page: 1
Go to End
Author Topic: 1189 Views
  • Anatol
    Avatar
    126 Posts

    i18n multilingual site: MySQL error Link to this post

    Hi Forum,

    I enabled multilingual content for a Silverstripe site. Everything worked well but when I tried to log in to the CMS today I get a MySQL error that is connected to the multilingual functionality:

    The problem is in a WHERE clause:

    "... WHERE (`SiteTree_lang_Live`.OriginalLangID = ) AND (`SiteTree_lang_Live`.Lang = 'mi') ..."

    The OriginalLangID is empty. OriginalLangID refers to the page in the original reference language (in this case English) and should be an integer with the ID of the original page in the site tree. I am not sure why and where this error originates from. Did anyone have similar problems? I did not do any special customisation.

    Even if I disable i18n I can no longer access the CMS.

    Cheers!
    Anatol

  • Anatol
    Avatar
    126 Posts

    Re: i18n multilingual site: MySQL error Link to this post

    I just found another post about this problem: http://silverstripe.com/site-builders-forum/flat/174862. It seems the problem is the login page itself which is not part of the site tree. Did anyone ever manage to make the login page work with i18n enabled?

    Cheers!
    Anatol

  • Anatol
    Avatar
    126 Posts

    Re: i18n multilingual site: MySQL error Link to this post

    Here is a temporary but very ugly solution:

    Simply create a static html file of the login form (e.g. create the file login_form.html in the Silverstripe root directory or anywhere else). You can simply copy and paste the generated source code of the actual login page so it looks like your template.

    Then open the .htaccess file and add this line below RewriteBase:

    RewriteRule ^(Security\/login)$ login_form.html

    Now every time you go to the URL my-silverstripe-site/admin/ it will redirect you to the static page.

    Be aware that the button "I've lost my password" will not work, but you could probably create a static page for that as well if you need it. The static form will also not remember the most recent page you had visited if that is what triggered the login form.

    As I said above this is just an ugly temporary hack (and not thoroughly tested) - good if you need a quick hotfix.

    I would be very keen to find a better solution. Please do post if you know one.

    Cheers!
    Anatol

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