17452 Posts in 4473 Topics by 1971 members
|Go to End|
24 November 2008 at 11:38am
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.
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?
24 November 2008 at 3:07pm Last edited: 24 November 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.
|Go to Top|