Skip to content

FIX Ensure site tree expands to show current child#2114

Draft
GuySartorelli wants to merge 1 commit intosilverstripe:2.4from
creative-commoners:pulls/2.4/fix-tree-expansion
Draft

FIX Ensure site tree expands to show current child#2114
GuySartorelli wants to merge 1 commit intosilverstripe:2.4from
creative-commoners:pulls/2.4/fix-tree-expansion

Conversation

@GuySartorelli
Copy link
Member

@GuySartorelli GuySartorelli commented Feb 12, 2026

There are various bugs related to expanding the site tree when the current item isn't loaded into the tree, which whis PR should fix.

Fixed scenarios

  • If the currently loaded page is one level deeper in the tree than what is currently loaded, the node will be loaded from the server and added to the tree but the tree won't expand.
    This PR fixes it by expanding the relevant parent after the child node is added to the tree.
  • If the currently loaded page is at least two levels deeper in the tree than what is currently loaded, self.jstree('load_node', -1); is called but results in an error (the main problem the linked issue is about)
    This PR fixes it by reinstating the mandatory callback passed to load_node which was removed in FIX jstree state when saving a page by retaining the open/closed state and selected node state #932

Remaining scenarios

  • If the currently loaded page is at least three levels deeper in the tree than what is currently loaded, self.jstree('load_node', -1, callback); is called but nothing happens. Looks like that's not recursive.

Issue

There are various bugs related to expanding the site tree when the
current item isn't loaded into the tree, which whis commit should fix.
@GuySartorelli GuySartorelli force-pushed the pulls/2.4/fix-tree-expansion branch from 0ebeee7 to 40cfdd8 Compare February 12, 2026 23:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant