CRM-13803 - hook_navigationMenu - Infer navID/parentID
authorTim Otten <totten@civicrm.org>
Tue, 13 Oct 2015 15:36:10 +0000 (16:36 +0100)
committerTim Otten <totten@civicrm.org>
Tue, 13 Oct 2015 15:36:10 +0000 (16:36 +0100)
commitb774b06593381aeba70fb2964fef4c860f11e153
tree300ede9eb4707be647f9fa336d10b27394982768
parent833c41aa14a91ab193e9c32c08c7f9a330a3aca8
CRM-13803 - hook_navigationMenu - Infer navID/parentID

This topic has previously been discussed a bit in
https://issues.civicrm.org/jira/browse/CRM-13803 and
https://github.com/civicrm/civihr/pull/190 .  Long-story short: when an
extension adds a new nav item, it must compute navID and parentID, and many
extensions do this a buggy way.

With this revision, an extension can simply omit the navID and parentID.
The navID will be computed (as the next available ID), and the parentID will
be inferred (based on the navID in the actual parent).
CRM/Core/BAO/Navigation.php
tests/phpunit/CRM/Core/BAO/NavigationTest.php