Call to a member function error

Permalink
I am having a problem with this error and I'm not sure how to prevent this from happening, and am not sure what has happened. I have just recently moved my website from XAMMP to Bluehost, this was not an error on XAMMP ever so I suspect that it is a database issue.

Call to a member function getRootTreeNodeObject() on a non-object

<?php defined('C5_EXECUTE') or die("Access Denied."); ?>
    <div class="ccm-block-topic-list-flat-filter">
    <?php
    $node = $tree->getRootTreeNodeObject();
    if (is_object($node)) {
    $node->populateDirectChildrenOnly(); ?>
    <ol class="breadcrumb">
    <li><a href="<?php echo $view->controller->getTopicLink()?>"
    <?php if (!$selectedTopicID) { ?>class="ccm-block-topic-list-topic-selected active"<?php } ?>><?php echo t('All')?></a></li>

 
A3020 replied on at Permalink Reply
A3020
Could be a DB error, but it can also be that errors were suppressed in your XAMPP environment.

It basically means that $tree doesn't have a function called "getRootTreeNodeObject". This could be because the variable isn't set, or because it isn't an object.

You should check the controller.php. The controller should 'pass' the $tree variable to the view.
carl101lee replied on at Permalink Reply
carl101lee
I have the same error on my portfolio home page after removing all the old topics? (Elemental Theme install) to replace with my new ones

Every time i try to access the page now I get an error

An unexpected error occurred.
Call to a member function getRootTreeNodeObject() on a non-object

I believe its a Database entry which may have got confused? Any idea's any one?

Carl
zanedev replied on at Permalink Reply
zanedev
It's supposed to be fixed in the next version 5.7.5 coming out. I have filed a bug and will close it if it is indeed fixed.
Trichter replied on at Permalink Reply
Well, I just upgraded to 5.7.5 to no avail, error's still present.
zanedev replied on at Permalink Reply
zanedev
Did you ever figure this out?
andrew replied on at Permalink Reply
andrew
Looks like the flat filter custom template isn't checking to see if the topic tree it's attached to exists. This happens when you delete a topic tree in the Dashboard, but existing blocks are still joined to it.

By adding a check

if (is_object($tree)) {


around all the code, this can be fixed. We will include this fix in 5.7.5.1
zanedev replied on at Permalink Reply
zanedev
strange my bug in the issue tracker disappeared even though this isn't fixed. was going to close it if it was fixed. also closed in github by andrew guess I'll reopen it there.

here is my github bug:
https://github.com/concrete5/concrete5/issues/2675...
Trichter replied on at Permalink Reply
Thank you, that did the trick.