3063 Posts in 864 Topics by 646 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 859 Views |
-
when Translatable enabled, JS error in CMS

22 September 2009 at 1:56am
Hi,
when i enable Translatable in _config.php, and login to admin, a JS error shows up when i select any page in sitetree of CMS.Im trying to add translations to all pages, and then add a language switcher to the theme and im stuck at the very beginning.
I would really appreciate if somebody could give me a hand as i want to allow my client start adding tri-lingual content to his website (polish ,english, german)
cheers,
QlexBelow is the error:
ERROR [Notice]: Object of class Panel could not be converted to int
IN POST /ztm/admin/getitem?ID=15&locale=pl_PL&ajax=1
Line 22 in /home/2eur/www/ztm/sapphire/forms/LanguageDropdownField.phpSource
======
13: * @param string $title
14: * @param array $excludeLocales List of locales that won't be included
15: * @param string $translatingClass Name of the class with translated instances where to look for
used languages
16: * @param string $list Indicates the source language list. Can be either Common-English,
Common-Native, Locale-English, Locale-Native
17: */
18: function __construct($name, $title, $excludeLocales = array(), $translatingClass = 'SiteTree',
$list = 'Common-English', $instance = null) {
19: $usedLocalesWithTitle = Translatable::get_existing_content_languages($translatingClass);
20: $usedLocalesWithTitle = array_diff_key($usedLocalesWithTitle, $excludeLocales);
21:
* 22: if('Common-English' == $list) $allLocalesWithTitle = i18n::get_common_languages();
23: else if('Common-Native' == $list) $allLocalesWithTitle = i18n::get_common_languages(true);
24: else if('Locale-English' == $list) $allLocalesWithTitle = i18n::get_common_locales();
25: else if('Locale-Native' == $list) $allLocalesWithTitle = i18n::get_common_locales(true);
26: else $allLocalesWithTitle = i18n::get_locale_list();
27:
28: if(isset($allLocales[Translatable::default_locale()]))
unset($allLocales[Translatable::default_locale()]);<ul>LanguageDropdownField->__construct(NewTransLang,Nowy język,Array,SiteTree,Object id #50)
line 879 of Translatable.phpTranslatable->updateCMSFields(Object id #47,,,,,,)
line 741 of Object.phpObject->extend(updateCMSFields,Object id #47)
line 1328 of SiteTree.phpSiteTree->getCMSFields(Object id #17)
line 390 of CMSMain.phpCMSMain->getEditForm(15)
line 925 of LeftAndMain.phpLeftAndMain->EditForm()
line 380 of LeftAndMain.phpLeftAndMain->getitem(Object id #15)
line 162 of Controller.phpController->handleAction(Object id #15)
line 129 of RequestHandler.phpRequestHandler->handleRequest(Object id #15)
line 122 of Controller.phpController->handleRequest(Object id #15)
line 277 of Director.phpDirector::handleRequest(Object id #15,Session)
line 121 of Director.phpDirector::direct(/admin/getitem)
line 118 of main.php</ul>
-
Re: when Translatable enabled, JS error in CMS

26 September 2009 at 12:26am
on irc simon helped me to provide a temporary solution to get rid of this JS error.
Steps required:
- edit sapphire/core/model/Translatable.php
- in line 873, after 'SiteTree', add 'Common-Native',with quote and comma being imporant.
This should make the error dissapear.
Qlex
| 859 Views | ||
|
Page:
1
|
Go to Top |

