CaseType managed entity in mgd.php file gets caught in an infinite loop
Overview
When using mgd.php file for a CaseType managed entity it creates an infinite loop when flushing the cache (which is when managed entities get checked). In CRM_Case_BAO_CaseType::add()
it calls CRM_Core_ManagedEntities::scheduleReconciliation()
which seems to create the loop.
Some chat here https://chat.civicrm.org/civicrm/pl/pmcn6sa9zpboigkh7f4ukxt8yr
Reproduction steps
- Create a new Case Type in the UI.
- Go to API4 and export the Case Type to PHP definition.
- Save to mgd.php file in an extension.
- Delete the custom case type.
- Enable the extension and flush cache (
cv flush
).
Current behaviour
Gets caught in an infinite loop, where it keeps trying to create the same case type (as I've noticed when going over it in XDebug).
Expected behaviour
Just create it once and stop.
Environment information
- __CiviCRM: 5.50.0 and up