PageTree cannot select/expand hidden nodes
TYPO3.Backend.NavigationContainer.PageTree.select(64) does not select the correct page, but tries to determine the correct node levels, fakes the local node states and reloads the page tree. One thing that might not be considered there is the fact that pages are represented in hex-values with a leading "p", thus the integer "64" with be converted to "p40" as node id.
To overcome this scenario and enable custom handling there, a new generic method is introduced:
TYPO3.Backend.NavigationContainer.PageTree.invokePageId(pageId, callback, allResults);
The methods "selectPageId" and "expandPageId" show how this is actually used.
Updated by Oliver Hader about 5 years ago
How to test?
- Apply the patch
- Clear all caches using the Install Tool (ExtDirect cache must be flushed)
- Find a nested page somewhere in the page tree and notice the page ID
- collapse all page branches
- reload the whole backend
- open the browser console and e.g. type (replace the number "20" with the page ID you've chosen)