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.

Customising the CMS /

Error getting Subtree


Reply


5 Posts   1475 Views

Avatar
lazerscience

Community Member, 16 Posts

19 May 2009 at 12:25am

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!

Avatar
PGiessler

Community Member, 47 Posts

19 May 2009 at 8:28pm

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

Best regards,

Pascal

Avatar
lazerscience

Community Member, 16 Posts

20 May 2009 at 6:04am

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!

Avatar
PGiessler

Community Member, 47 Posts

20 May 2009 at 7:15pm

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

Avatar
lazerscience

Community Member, 16 Posts

21 May 2009 at 4:13am

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! :-(