On a page we have a stack with a topic list controlling a page list.
Browsing the page is possible but the topic list has stopped working and when you have logged in to remove the faulty stack, this error is shown:
“Call to a member function getRootTreeNodeObject() on null” and you can’t remove the stack.
Any ideas on how to remove a stack when it can not be done in the GUI?
The log shows this error:
“…/web/application/blocks/topic_list/templates/flat_filter_nav/view.php:5 Call to a member function getRootTreeNodeObject() on null (0)!”
I am assuming the page is erroring out, but you can still reach the dashboard? if you can get to the dash, you can go to “Stacks & Blocks” then “Stacks & Global areas” you will be able to delete the problematic block from there.
flat_filter_nav/view.php:5… What’s happening on line 5 of your template? Was the topic associated with this topic list deleted by chance? Or possibly had it’s handle changed?
I didn’t have the courage to delete it from the Full Sitemap because of this apocalyptical warning:
“Warning! This is a system page. Deleting it could potentially break your site. Please proceed with caution.”
But maybe it’s safe?
On line five I have:
$node = $tree->getRootTreeNodeObject();
I don’t recall anything has been deleted and the crazy thing is that I’ve created a new identical stack with the same template – and that one works.
This may be a naïve suggestion and perhaps you’ve already tried it…
On the page where you have the stack with a topic list, is there a previous version you can roll back to that doesn’t cause the error? If so, without error it may give a bit more latitude to delete or repair the stack via the GUI.
Maybe commenting out the area with the non working stack in the templates and adding a new area for a working one will work.
/* $a = new Area(’non-working-stack');
$a->display($c);
*/
$a = new Area('working-stack');
$a->display($c);
?>
This way the visitors will not get any errors visiting the site and I can delete the non working stack with your code or in the Site View without users getting errors browsing the site.
You can paste it in practically any .php file in theme folder (default.php/header_top.php - etc.) and refresh page in browser.
Remember to delete that code when you are finished.
Yeah, you can comment old area and create new one with different name, if that solves your problems. Data from old area will not be deleted anyway.