Civix upgrade on event cart
authorEileen McNaughton <emcnaughton@wikimedia.org>
Mon, 16 Jan 2023 23:07:35 +0000 (12:07 +1300)
committerEileen McNaughton <emcnaughton@wikimedia.org>
Mon, 16 Jan 2023 23:07:35 +0000 (12:07 +1300)
ext/eventcart/eventcart.civix.php
ext/eventcart/eventcart.php
ext/eventcart/info.xml

index 609fdb2e6e7b3108788aa10c1c3259ab81e33d16..91bd958e3b75ccb3c4c34901b681c9fb4f7d7d46 100644 (file)
@@ -84,27 +84,22 @@ use CRM_Event_Cart_ExtensionUtil as E;
  *
  * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_config
  */
-function _eventcart_civix_civicrm_config(&$config = NULL) {
+function _eventcart_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];
+  if (file_exists($extDir)) {
+    CRM_Core_Smarty::singleton()->addTemplateDir($extDir);
   }
 
   $include_path = $extRoot . PATH_SEPARATOR . get_include_path();
   set_include_path($include_path);
+  // Based on <compatibility>, this does not currently require mixin/polyfill.php.
 }
 
 /**
@@ -114,35 +109,7 @@ function _eventcart_civix_civicrm_config(&$config = NULL) {
  */
 function _eventcart_civix_civicrm_install() {
   _eventcart_civix_civicrm_config();
-  if ($upgrader = _eventcart_civix_upgrader()) {
-    $upgrader->onInstall();
-  }
-}
-
-/**
- * Implements hook_civicrm_postInstall().
- *
- * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_postInstall
- */
-function _eventcart_civix_civicrm_postInstall() {
-  _eventcart_civix_civicrm_config();
-  if ($upgrader = _eventcart_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 _eventcart_civix_civicrm_uninstall(): void {
-  _eventcart_civix_civicrm_config();
-  if ($upgrader = _eventcart_civix_upgrader()) {
-    $upgrader->onUninstall();
-  }
+  // Based on <compatibility>, this does not currently require mixin/polyfill.php.
 }
 
 /**
@@ -152,56 +119,7 @@ function _eventcart_civix_civicrm_uninstall(): void {
  */
 function _eventcart_civix_civicrm_enable(): void {
   _eventcart_civix_civicrm_config();
-  if ($upgrader = _eventcart_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 _eventcart_civix_civicrm_disable(): void {
-  _eventcart_civix_civicrm_config();
-  if ($upgrader = _eventcart_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 _eventcart_civix_civicrm_upgrade($op, CRM_Queue_Queue $queue = NULL) {
-  if ($upgrader = _eventcart_civix_upgrader()) {
-    return $upgrader->onUpgrade($op, $queue);
-  }
-}
-
-/**
- * @return CRM_Event_Cart_Upgrader
- */
-function _eventcart_civix_upgrader() {
-  if (!file_exists(__DIR__ . '/CRM/Event/Cart/Upgrader.php')) {
-    return NULL;
-  }
-  else {
-    return CRM_Event_Cart_Upgrader_Base::instance();
-  }
+  // Based on <compatibility>, this does not currently require mixin/polyfill.php.
 }
 
 /**
index d160a35861ac025fc27bed03f88d736a8e50f91e..df46e2bc7f6ea6055194d3da3a7b7276e1bf5821 100644 (file)
@@ -32,24 +32,6 @@ function eventcart_civicrm_install() {
   _eventcart_civix_civicrm_install();
 }
 
-/**
- * Implements hook_civicrm_postInstall().
- *
- * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_postInstall
- */
-function eventcart_civicrm_postInstall() {
-  _eventcart_civix_civicrm_postInstall();
-}
-
-/**
- * Implements hook_civicrm_uninstall().
- *
- * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_uninstall
- */
-function eventcart_civicrm_uninstall() {
-  _eventcart_civix_civicrm_uninstall();
-}
-
 /**
  * Implements hook_civicrm_enable().
  *
@@ -59,24 +41,6 @@ function eventcart_civicrm_enable() {
   _eventcart_civix_civicrm_enable();
 }
 
-/**
- * Implements hook_civicrm_disable().
- *
- * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_disable
- */
-function eventcart_civicrm_disable() {
-  _eventcart_civix_civicrm_disable();
-}
-
-/**
- * Implements hook_civicrm_upgrade().
- *
- * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_upgrade
- */
-function eventcart_civicrm_upgrade($op, CRM_Queue_Queue $queue = NULL) {
-  return _eventcart_civix_civicrm_upgrade($op, $queue);
-}
-
 /**
  * Implements hook_civicrm_entityTypes().
  *
index 861003aeb8435fd5197831cf9f9a010864b01393..f485d04adc24375cbd6f63cfd238df902797d2e9 100644 (file)
@@ -31,6 +31,6 @@
   </mixins>
   <civix>
     <namespace>CRM/Event/Cart</namespace>
-    <format>22.10.0</format>
+    <format>22.12.1</format>
   </civix>
 </extension>