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.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

TableListField in Translatable


Reply


630 Views

Avatar
k0m0r

Community Member, 39 Posts

12 May 2011 at 9:21am

Hi.

I've just found a very strange behaviour of TableListFields when using Translatable.
For example I have a ManyManyComplexTableField filled with a list of pages:

$table = new ManyManyComplexTableField(
$this,
'References',
'ArticlePage',
array(
'Title' => 'Title',
),
'getCMSFields_forPopup'
);

When Translatable is enabled, this should show up a list of all ArticlePages existing in database, that have locale exact to current page locale. And this works perfect.
But when I'm editing the page in locale other than default, switching the page in table fills it up with ArticlePages from default locale. For example:

My default locale is en_GB, another allowed locale is de_DE. I have 18 ArticlePages in en_GB and 12 in de_DE locale.
When I open a German page in CMS, the table is filled with German ArticlePages and the counter shows 12 total. But switching the page magically shows up English ArticlePages from 10 to 18 and the counter switches to 18 total.

I've been trying to trace it down, but failed. If anyone got an idea why this is happening, please help. Could there be anything wrong with my data model, or did I just find a bug?

Thanks a lot,

k0m0r