mirror of
https://github.com/silverstripe/silverstripe-translatable
synced 2024-10-22 11:05:59 +02:00
BUGFIX Added Translatable->updateSettingsFields(), fixed related unit test
This commit is contained in:
parent
7348ce7077
commit
edcb9ae582
@ -1028,6 +1028,10 @@ class Translatable extends DataExtension implements PermissionProvider {
|
||||
$langDropdown->addExtraClass('languageDropdown');
|
||||
$createButton->addExtraClass('createTranslationButton');
|
||||
}
|
||||
|
||||
function updateSettingsFields(&$fields) {
|
||||
return $this->updateCMSFields();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the names of all translatable fields on this class
|
||||
|
@ -868,7 +868,7 @@ class TranslatableTest extends FunctionalTest {
|
||||
|
||||
$adminUser->logIn();
|
||||
|
||||
$cmsMain = new CMSMain();
|
||||
$cmsMain = new CMSPageEditController();
|
||||
|
||||
$origLocale = Translatable::get_current_locale();
|
||||
Translatable::set_current_locale('fr_FR');
|
||||
@ -876,13 +876,11 @@ class TranslatableTest extends FunctionalTest {
|
||||
$form = $cmsMain->getEditForm($frPage->ID);
|
||||
$form->loadDataFrom(array(
|
||||
'Title' => 'Translated', // $db field
|
||||
'ViewerGroups' => $group->ID // $many_many field
|
||||
));
|
||||
$form->saveInto($frPage);
|
||||
$frPage->write();
|
||||
|
||||
$this->assertEquals('Translated', $frPage->Title);
|
||||
$this->assertEquals(array($group->ID), $frPage->ViewerGroups()->column('ID'));
|
||||
|
||||
$adminUser->logOut();
|
||||
Translatable::set_current_locale($origLocale);
|
||||
|
Loading…
Reference in New Issue
Block a user