Jump to:

5542 Posts in 1739 Topics by 1225 members

Customising the CMS

SilverStripe Forums » Customising the CMS » Error getting Subtree

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

Page: 1
Go to End
Author Topic: 1410 Views
  • lazerscience
    Avatar
    Community Member
    16 Posts

    Error getting Subtree Link to this post

    Hi!
    I have a big problem within the Silverstripe backend! I'm using Translatable to make a multilingual site.
    But there are trees that I can open in one language (I think its the original one), but not in others in the backend; I tried it with the trunk version first, this always gave me "Error loading Subtree", today I have tried with the Beta and it gives me

    Fatal error: Call to a member function markPartialTree() on a non-object in /Applications/xampp/xamppfiles/htdocs/sputnic2/cms/code/LeftAndMain.php on

    directly in the sitetree!
    I suppose my classes seem to be ok, since they are working without problems in other places! Please help, because I cant get it working and the site needs to go live as soon as possible!

    Thanks!

  • PGiessler
    Avatar
    Community Member
    47 Posts

    Re: Error getting Subtree Link to this post

    Can you show me your _config.php? I think there is a error in your configuration.

    Best regards,

    Pascal

  • lazerscience
    Avatar
    Community Member
    16 Posts

    Re: Error getting Subtree Link to this post

    my _config.php:

    <?php

    global $project;
    $project = 'mysite';

    global $databaseConfig;
    $databaseConfig = array(
       "type" => "MySQLDatabase",
       "server" => "localhost",
       "username" => "root",
       "password" => "",
       "database" => "SS_sputnic2",
    );

    // Sites running on the following servers will be
    // run in development mode. See
    // http://doc.silverstripe.com/doku.php?id=devmode
    // for a description of what dev mode does.
    Director::set_dev_servers(array(
       'localhost',
       '127.0.0.1',
    ));

    Translatable::set_default_locale('de_DE');
    Translatable::enable();

    // This line set's the current theme. More themes can be
    // downloaded from http://www.silverstripe.com/themes/
    SSViewer::set_theme('sputnic');

    ?>

    I've tried to track the problem down a bit, the ajax request /admin/getsubtree?ajax=1&ID=9 doesnt seem to be properly working, for some ids (of the same page type) it does, for some not; I've tried to compare the database rows for working and not-working IDs, but couldnt find any difference... I think the problem is that for some IDs the getRecord methog in LeftandMain.php returns anm object and for some not, couldnt find any more reasons yet!

    Thanks!

  • PGiessler
    Avatar
    Community Member
    47 Posts

    Re: Error getting Subtree Link to this post

    Hi lazerscience,

    I think I've the solution of your problem. You are using an old documentation of Translatable content. With the new documentation I can translate any content without an error report.

    ■ Use Object::has_extension(’SiteTree’,’Translatable) instead of Translatable::is_enabled()’’.

    You should read the feature changes of 2.3.2 ( http://doc.silverstripe.com/doku.php?id=upgrading:2.3.2).

    Best regards,

    Pascal

  • lazerscience
    Avatar
    Community Member
    16 Posts

    Re: Error getting Subtree Link to this post

    Thanks for you help Pascal, but in fact I do that through the extensions array...

    class Page extends SiteTree {
       
       static $extensions = array(
        "Translatable"
        );
    ....


    which also goes according to the tutorial for 2.3.2! I tried it the other way right now, as you described, but the problem remains! And I'm not sure that it is a Translatable problem, because translations work for me perfectly and it's just some certain subtrees in some languages I can't open anymore!

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