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.

Archive /

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

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

i18n multilingual site: MySQL error


Go to End


3 Posts   1658 Views

Avatar
Anatol

126 Posts

24 November 2008 at 11:38am

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

Avatar
Anatol

126 Posts

24 November 2008 at 12:01pm

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

Avatar
Anatol

126 Posts

24 November 2008 at 3:07pm

Edited: 24/11/2008 3:08pm

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