I am creating a distribution Drupal profile which is bundling CiviCRM and CiviCRM extensions.
Currently, I am having an issue with extensions that CiviCRM settings, for example, Mosaico Extension is using CiviCRM settings for configuration templates, graphic engine etc so after Mosaico extension is completely installed, the Mosaico settings have not been set and you need to flush the system cache.
According to CiviCRM| document https://docs.civicrm.org/dev/en/latest/framework/setting/
Your setting will not be active until you run flush all caches (e.g cv flush or drush cvapi System.flush)
The current version of CiviCRM, Drupal and the extension that are being used.
- CiviCRM version 5.19.4
- Drupal version 7.69
- Mosaico version 2.3
When I am trying to flush the system cache via CiviCRM API, flush Cache directly via CRM_Extension_System class or calling cleanupCaches on the CRM_Core_config class. None of these is working.
civicrm_api3('System', 'flush'); \CRM_Extension_System::singleton()->getCache()->flush(); $config = \CRM_Core_Config::singleton(); $config->clearModuleList(); $config->cleanupCaches();
Is there a way to flush a system cache and load the configuration during Profile installation?
I have also tried to create settings after the extension is installed and got the error so I understand that the settings are not activated yet.