From af34abeaf60e2b7fe080308bfb07bc62d833b5d3 Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Tue, 17 Jan 2023 10:05:50 +1300 Subject: [PATCH] Re-run civix upgrade on flexmailer Also see https://github.com/civicrm/civicrm-core/pull/25249 --- ext/flexmailer/flexmailer.civix.php | 94 ++--------------------------- ext/flexmailer/flexmailer.php | 36 ----------- ext/flexmailer/info.xml | 2 +- 3 files changed, 6 insertions(+), 126 deletions(-) diff --git a/ext/flexmailer/flexmailer.civix.php b/ext/flexmailer/flexmailer.civix.php index 92186e7632..6a215af368 100644 --- a/ext/flexmailer/flexmailer.civix.php +++ b/ext/flexmailer/flexmailer.civix.php @@ -84,27 +84,20 @@ use CRM_Flexmailer_ExtensionUtil as E; * * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_config */ -function _flexmailer_civix_civicrm_config(&$config = NULL) { +function _flexmailer_civix_civicrm_config($config = NULL) { static $configured = FALSE; if ($configured) { return; } $configured = TRUE; - $template = CRM_Core_Smarty::singleton(); - $extRoot = __DIR__ . DIRECTORY_SEPARATOR; $extDir = $extRoot . 'templates'; - - if (is_array($template->template_dir)) { - array_unshift($template->template_dir, $extDir); - } - else { - $template->template_dir = [$extDir, $template->template_dir]; - } + CRM_Core_Smarty::singleton()->addTemplateDir($extDir); $include_path = $extRoot . PATH_SEPARATOR . get_include_path(); set_include_path($include_path); + // Based on , this does not currently require mixin/polyfill.php. } /** @@ -114,35 +107,7 @@ function _flexmailer_civix_civicrm_config(&$config = NULL) { */ function _flexmailer_civix_civicrm_install() { _flexmailer_civix_civicrm_config(); - if ($upgrader = _flexmailer_civix_upgrader()) { - $upgrader->onInstall(); - } -} - -/** - * Implements hook_civicrm_postInstall(). - * - * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_postInstall - */ -function _flexmailer_civix_civicrm_postInstall() { - _flexmailer_civix_civicrm_config(); - if ($upgrader = _flexmailer_civix_upgrader()) { - if (is_callable([$upgrader, 'onPostInstall'])) { - $upgrader->onPostInstall(); - } - } -} - -/** - * Implements hook_civicrm_uninstall(). - * - * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_uninstall - */ -function _flexmailer_civix_civicrm_uninstall(): void { - _flexmailer_civix_civicrm_config(); - if ($upgrader = _flexmailer_civix_upgrader()) { - $upgrader->onUninstall(); - } + // Based on , this does not currently require mixin/polyfill.php. } /** @@ -152,56 +117,7 @@ function _flexmailer_civix_civicrm_uninstall(): void { */ function _flexmailer_civix_civicrm_enable(): void { _flexmailer_civix_civicrm_config(); - if ($upgrader = _flexmailer_civix_upgrader()) { - if (is_callable([$upgrader, 'onEnable'])) { - $upgrader->onEnable(); - } - } -} - -/** - * (Delegated) Implements hook_civicrm_disable(). - * - * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_disable - * @return mixed - */ -function _flexmailer_civix_civicrm_disable(): void { - _flexmailer_civix_civicrm_config(); - if ($upgrader = _flexmailer_civix_upgrader()) { - if (is_callable([$upgrader, 'onDisable'])) { - $upgrader->onDisable(); - } - } -} - -/** - * (Delegated) Implements hook_civicrm_upgrade(). - * - * @param $op string, the type of operation being performed; 'check' or 'enqueue' - * @param $queue CRM_Queue_Queue, (for 'enqueue') the modifiable list of pending up upgrade tasks - * - * @return mixed - * based on op. for 'check', returns array(boolean) (TRUE if upgrades are pending) - * for 'enqueue', returns void - * - * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_upgrade - */ -function _flexmailer_civix_civicrm_upgrade($op, CRM_Queue_Queue $queue = NULL) { - if ($upgrader = _flexmailer_civix_upgrader()) { - return $upgrader->onUpgrade($op, $queue); - } -} - -/** - * @return CRM_Flexmailer_Upgrader - */ -function _flexmailer_civix_upgrader() { - if (!file_exists(__DIR__ . '/CRM/Flexmailer/Upgrader.php')) { - return NULL; - } - else { - return CRM_Flexmailer_Upgrader_Base::instance(); - } + // Based on , this does not currently require mixin/polyfill.php. } /** diff --git a/ext/flexmailer/flexmailer.php b/ext/flexmailer/flexmailer.php index bf3047f427..7397be2abf 100644 --- a/ext/flexmailer/flexmailer.php +++ b/ext/flexmailer/flexmailer.php @@ -32,24 +32,6 @@ function flexmailer_civicrm_install() { _flexmailer_civix_civicrm_install(); } -/** - * Implements hook_civicrm_postInstall(). - * - * @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_postInstall - */ -function flexmailer_civicrm_postInstall() { - _flexmailer_civix_civicrm_postInstall(); -} - -/** - * Implements hook_civicrm_uninstall(). - * - * @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_uninstall - */ -function flexmailer_civicrm_uninstall() { - _flexmailer_civix_civicrm_uninstall(); -} - /** * Implements hook_civicrm_enable(). * @@ -59,24 +41,6 @@ function flexmailer_civicrm_enable() { _flexmailer_civix_civicrm_enable(); } -/** - * Implements hook_civicrm_disable(). - * - * @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_disable - */ -function flexmailer_civicrm_disable() { - _flexmailer_civix_civicrm_disable(); -} - -/** - * Implements hook_civicrm_upgrade(). - * - * @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_upgrade - */ -function flexmailer_civicrm_upgrade($op, CRM_Queue_Queue $queue = NULL) { - return _flexmailer_civix_civicrm_upgrade($op, $queue); -} - /** * Implements hook_civicrm_navigationMenu(). * diff --git a/ext/flexmailer/info.xml b/ext/flexmailer/info.xml index 9725fbf016..cc4960f971 100644 --- a/ext/flexmailer/info.xml +++ b/ext/flexmailer/info.xml @@ -37,6 +37,6 @@ CRM/Flexmailer - 22.10.0 + 22.12.1 -- 2.25.1