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're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

DataObjectManager Module /

Discuss the DataObjectManager module, and the related ImageGallery module.

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

DataObjectManager and Translations

Go to End

2 Posts   1566 Views

Dave L

Community Member, 60 Posts

23 February 2010 at 3:17pm


I'm having an issue with DataObjects attaching to wrong translation pages.


class FAQPage extends Page {

    static $has_many = array (
        'FAQs' => 'FAQ'

    public function getCMSFields() {
      $fields = parent::getCMSFields();
      $dom = new DataObjectManager(
            "FAQPageID = $this->ID"
      $fields->addFieldToTab("Root.Content.FAQ", $dom);
      return $fields;



class FAQ extends DataObject {

    static $db = array (
    'Question' => 'Text',
    'Answer' => 'Text'
    static $has_one = array (
      'FAQPage' => 'FAQPage'
    public function getCMSFields_forPopup()
        return new FieldSet(
            new TextField('Question'),
            new TextField('Answer')



When I go to the English version of FAQPage I can add FAQs fine. Then I select translations and choose the translated page (Mandarin in this case) and the FAQ DOM shows empty, as you'd expect. I add a new FAQ but then when I close lightbox the page refreshes showing all FAQ - the one I added plus the English ones. If I refresh the FAQ including the one I added are gone. Then If I switch back to English through the translations tab all FAQ including the Chinese one added show there. Then all FAQs show in the English page since the FAQPageID is the same for all.

Am I doing something wrong?


If I am viewing the English sitetree, then use the language dropdown > switch to Mandarin > select FAQPage > select FAQ tab > select "add a new FAQ" I get the error "I can't handle sub-URLs of a CMSMain object." in the lightbox popup.

This is revision 216. Please note there is a change between r216 and r217 that renders lightbox fullscreen (full window) on my browser (Mac FireFox 3.5.4).

Dave L

Community Member, 60 Posts

24 February 2010 at 4:11pm

Looks like the issue is locale not being propagated. See

So it's attaching to the master page, not the translated one.