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.

All other Modules /

Discuss all other Modules here.

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

Translatable causing problems admin panel


Go to End


6 Posts   2275 Views

Avatar
Blackthorn87

Community Member, 34 Posts

9 August 2013 at 3:00am

Edited: 09/08/2013 3:07am

Hi Everyone,

I'm using the translatable module to create a multilingual website for a client and it seems to be playing havoc with the admin panel. When you go to the files tab, and then click on a folder it appends "?locale=en_GB" to the end of the URL. This sometimes creates a silverstripe popup saying "Internal Server Error". Here is a copy of what is written in my "mysite/_config.php" file:

// Set the site locale
i18n::set_locale('en_GB');

// Enable custom site config details
DataObject::add_extension('SiteConfig', 'CustomConfig');

// Set the languages you wish to have available
i18n::$common_locales = array(
	'en_GB' => array('English (UK)', 'English (UK)'),
	'fr_FR' => array('French', 'français'),
	'de_DE' => array('German', 'Deutsch')
);

// Set the default locale for multi-lingual site
Translatable::set_default_locale('en_GB');

// Sets the environment type to dev, test, live
Director::set_environment_type('dev');

I am running SilverStripe 3.0.5 and translatable module 1.0. From what I can tell these are both supposed to be compatible with each other.

I've also just found that all Model Admins for all the custom Data Objects I've created are broken because the translatable module keeps appending "?locale=en_GB" to the end of everything.

If you need anymore information please just ask.

Thanks,

Arun

Avatar
Blackthorn87

Community Member, 34 Posts

21 August 2013 at 4:41am

Hi All,

Seeing as no one has any idea about this I've setup the error emails and here is the content of one of them:

[Error] Uncaught Exception: Object->__call(): the method 'gettranslation' does not exist on 'Folder'
/home/autotech/public_html/framework/core/Object.php:675 
•	Object->__call(getTranslation,Array) 
TranslatableCMSMainExtension.php:34
•	Folder->getTranslation(en_GB) 
TranslatableCMSMainExtension.php:34
•	TranslatableCMSMainExtension->init(,,,,,,) 
Object.php:913
•	Object->extend(init,) 
LeftAndMain.php:349
•	LeftAndMain->init() 
AssetAdmin.php:57
•	AssetAdmin->init() 
Controller.php:139
•	Controller->handleRequest(SS_HTTPRequest,DataModel) 
LeftAndMain.php:357
•	LeftAndMain->handleRequest(SS_HTTPRequest,DataModel) 
AdminRootController.php:89
•	AdminRootController->handleRequest(SS_HTTPRequest,DataModel) 
Director.php:296
•	Director::handleRequest(SS_HTTPRequest,Session,DataModel) 
Director.php:119
•	Director::direct(/admin/assets/EditorToolbar/viewfile,DataModel) 
main.php:126
Details
$_SERVER['HTTP_ACCEPT']	*/*
$_SERVER['HTTP_ACCEPT_CHARSET']	
$_SERVER['HTTP_ACCEPT_ENCODING']	gzip,deflate,sdch
$_SERVER['HTTP_ACCEPT_LANGUAGE']	en-US,en;q=0.8,en-GB;q=0.6,fa;q=0.4
$_SERVER['HTTP_REFERRER']	
$_SERVER['HTTP_USER_AGENT']	Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.95 Safari/537.36
$_SERVER['HTTPS']	
$_SERVER['REMOTE_ADDR']	31.24.219.171

This is what I get when I try to access a folder using the file management system built into the CMS.

If you need any more information please just ask as it would be nice to get this problem sovled.

Thanks in advance.

Avatar
MJA

Community Member, 21 Posts

22 August 2013 at 3:01am

I am getting the exact same problem

Trying to find a solution, but not having any ideas yet

It anyone can point me in the right direction I'd be very grateful

Avatar
Ingo

Forum Moderator, 801 Posts

29 August 2013 at 1:08am

The URL you're trying to access is /admin/assets/EditorToolbar/viewfile. Did you add a HTMLEditorField to your File class through a DataExtension? I can't reproduce this. Can you narrow down the example to just a standard installation of the latest 3.0 branch plus translatable?

composer create-project silverstripe/installer 3.0.x-dev 3.0.x-dev
cd 3.0.x-dev
composer require silverstripe/translatable:*

Avatar
carlo

Community Member, 6 Posts

3 September 2013 at 1:25pm

Edited: 08/09/2013 2:14pm

Exactly the same problem…

UPDATE: Sorry, I used Version 1.0.0 from silverstripe.org… Version 1.0 from GitHub is different and solved my problem!

Avatar
Blackthorn87

Community Member, 34 Posts

13 September 2013 at 9:00pm

Hi Guys,

In order to get around this problem I have used the latest beta version of SilverStripe (3.1 RC1) and the next compatible version of translatable. Sorry I could check out any other methods to fix this, but am on a tight deadline to get the site finished and after testing the beta version it was fit for purpose.

Thanks anyway.