Jump to:

11001 Posts in 2733 Topics by 1823 members

All other Modules

SilverStripe Forums » All other Modules » Translatable causing problems admin panel

Discuss all other Modules here.

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

Page: 1
Go to End
Author Topic: 695 Views
  • Blackthorn87
    Avatar
    Community Member
    27 Posts

    Translatable causing problems admin panel Link to this post

    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

  • Blackthorn87
    Avatar
    Community Member
    27 Posts

    Re: Translatable causing problems admin panel Link to this post

    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.

  • MJA
    Avatar
    Community Member
    16 Posts

    Re: Translatable causing problems admin panel Link to this post

    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

  • Ingo
    Avatar
    Forum Moderator
    801 Posts

    Re: Translatable causing problems admin panel Link to this post

    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:*

  • carlo
    Avatar
    Community Member
    5 Posts

    Re: Translatable causing problems admin panel Link to this post

    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!

  • Blackthorn87
    Avatar
    Community Member
    27 Posts

    Re: Translatable causing problems admin panel Link to this post

    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.

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