akeeba / fof

Rapid Application Development framework for Joomla!™ 3 and 4
0 stars 0 forks source link

TreeModel->getParent() #585

Closed willfaulds closed 8 years ago

willfaulds commented 8 years ago

TreeModel->getParent()

I believe the scope of the initial SQL query is too narrow (my terminology is probably wrong) meaning it cannot find the root node as a parent.

My test data is: Title lft rgt root 1 6 cat1 2 5 cat2 3 4

->getParent() works fine on root & cat2 but on cat1 exits shows not Items with firstOrFail

My quick workaround solution

nikosdion commented 8 years ago

This is already covered by the tests, see https://github.com/akeeba/fof/tree/development/Tests/Model/TreeModelDataprovider.php#L921-L921 especially the "Child node, first level" case. The method works correctly as you can see in the tests..