Retrieve ID of Administer menu item from passed params
When this Extension is in use in WordPress Multisite, the "CiviDiscount" is improperly added to the CiviCRM Navigation Menu when the domain_id
is not the primary one.
The reason is that CRM_Core_DAO::getFieldValue()
does not default to the current domain_id
and returns the first item that it finds - which is the menu item for the primary domain_id
. This causes the "CiviDiscount" menu item to be improperly added.
The $params
passed to cividiscount_civicrm_navigationMenu()
do however contain the correct menu data, so searching the array produces the correct ID for the "Administer" menu.
FWIW, it seems that this is a common way of finding the Administer menu item - CiviRules does it the same way and suffers from the same problem.