[MAGNOLIA-1538] Tree does not work if setPath() is used in custom tree configuration Created: 18/May/07  Updated: 29/Aug/12  Resolved: 29/Aug/12

Status: Closed
Project: Magnolia
Component/s: admininterface
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major
Reporter: zam6ak Assignee: Philipp Bärfuss
Resolution: Not an issue Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Firefox 2
Internet Explorer 6


Issue Links:
duplicate
is duplicated by MGNLDMS-99 Creating custom tree configuration fo... Closed
relation
is related to MAGNOLIA-1537 AdminTreeMVCHandler could accept tree... Closed
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Date of First Response:

 Description   

If specifyiing a custom tree config with a setPath(), the tree does not function properly. Trying to expand subitems causes weird behaviour...

Steps to reproduce (thanks to Gregory):

1) Create a new tree configuration class:
public class MyTreeConfiguration extends WebsiteTreeConfiguration {
public void prepareTree(Tree tree, boolean browseMode, HttpServletRequest request)

{ super.prepareTree(tree, browseMode, request); tree.setPath("/foobar"); }

}
Deploy that class in magnolia.

2) Reference the configuration in a new tree definition:
.../my-new-tree/configurationClass : info.magnolia.test.
MyTreeConfiguration

3) Finally, setup my dialog's link control with a "tree" property set to the newly created Tree ("my-new-tree")



 Comments   
Comment by Magnolia International [ 18/May/07 ]

Woops, indeed, sorry for that.

Comment by Magnolia International [ 21/May/07 ]

In fact, it is not supposed to work (my bad), as the setPath method is used to set the current path (indirectly called by the ajax scripts when opening tree branches)
I think we'd need something like an extra setRootPath method to do what you want.

Comment by Philipp Bracher [ 22/May/07 ]

Do not set the path for subsequent (ajax) requests:

if(tree.getPath().equals("/"))

{ tree.setPath("/something"); }
Comment by Magnolia International [ 10/Sep/08 ]

See MGNLDMS-99 for a working example and some more explanations as to why this might fail.

Generated at Mon Feb 12 03:27:53 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.