From d44b118b96521edcd6a89247281417065d37e20c Mon Sep 17 00:00:00 2001 From: colemanw Date: Sun, 24 Sep 2023 09:22:54 -0400 Subject: [PATCH] Afform - run civix upgrade --- ext/afform/admin/afform_admin.civix.php | 4 +- ext/afform/admin/info.xml | 4 +- ext/afform/html/afform_html.civix.php | 110 ++---------------------- ext/afform/html/afform_html.php | 47 ---------- ext/afform/html/info.xml | 5 +- ext/afform/mock/afform_mock.civix.php | 110 ++---------------------- ext/afform/mock/afform_mock.php | 47 ---------- ext/afform/mock/info.xml | 5 +- 8 files changed, 24 insertions(+), 308 deletions(-) diff --git a/ext/afform/admin/afform_admin.civix.php b/ext/afform/admin/afform_admin.civix.php index 52866d86b8..eb9df12ea5 100644 --- a/ext/afform/admin/afform_admin.civix.php +++ b/ext/afform/admin/afform_admin.civix.php @@ -133,8 +133,8 @@ function _afform_admin_civix_insert_navigation_menu(&$menu, $path, $item) { if (empty($path)) { $menu[] = [ 'attributes' => array_merge([ - 'label' => CRM_Utils_Array::value('name', $item), - 'active' => 1, + 'label' => $item['name'] ?? NULL, + 'active' => 1, ], $item), ]; return TRUE; diff --git a/ext/afform/admin/info.xml b/ext/afform/admin/info.xml index c4fc1de133..2d999535a4 100644 --- a/ext/afform/admin/info.xml +++ b/ext/afform/admin/info.xml @@ -25,7 +25,7 @@ CRM/AfformAdmin - 23.02.0 + 23.02.1 @@ -36,7 +36,7 @@ menu-xml@1.0.0 mgd-php@1.0.0 afform-entity-php@1.0.0 - smarty-v2@1.0.0 + smarty-v2@1.0.1 CRM_AfformAdmin_Upgrader diff --git a/ext/afform/html/afform_html.civix.php b/ext/afform/html/afform_html.civix.php index 31c33437bb..c7d8887f54 100644 --- a/ext/afform/html/afform_html.civix.php +++ b/ext/afform/html/afform_html.civix.php @@ -84,27 +84,17 @@ use CRM_AfformHtml_ExtensionUtil as E; * * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_config */ -function _afform_html_civix_civicrm_config(&$config = NULL) { +function _afform_html_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]; - } - $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 +104,7 @@ function _afform_html_civix_civicrm_config(&$config = NULL) { */ function _afform_html_civix_civicrm_install() { _afform_html_civix_civicrm_config(); - if ($upgrader = _afform_html_civix_upgrader()) { - $upgrader->onInstall(); - } -} - -/** - * Implements hook_civicrm_postInstall(). - * - * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_postInstall - */ -function _afform_html_civix_civicrm_postInstall() { - _afform_html_civix_civicrm_config(); - if ($upgrader = _afform_html_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 _afform_html_civix_civicrm_uninstall(): void { - _afform_html_civix_civicrm_config(); - if ($upgrader = _afform_html_civix_upgrader()) { - $upgrader->onUninstall(); - } + // Based on , this does not currently require mixin/polyfill.php. } /** @@ -152,56 +114,7 @@ function _afform_html_civix_civicrm_uninstall(): void { */ function _afform_html_civix_civicrm_enable(): void { _afform_html_civix_civicrm_config(); - if ($upgrader = _afform_html_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 _afform_html_civix_civicrm_disable(): void { - _afform_html_civix_civicrm_config(); - if ($upgrader = _afform_html_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 _afform_html_civix_civicrm_upgrade($op, CRM_Queue_Queue $queue = NULL) { - if ($upgrader = _afform_html_civix_upgrader()) { - return $upgrader->onUpgrade($op, $queue); - } -} - -/** - * @return CRM_AfformHtml_Upgrader - */ -function _afform_html_civix_upgrader() { - if (!file_exists(__DIR__ . '/CRM/AfformHtml/Upgrader.php')) { - return NULL; - } - else { - return CRM_AfformHtml_Upgrader_Base::instance(); - } + // Based on , this does not currently require mixin/polyfill.php. } /** @@ -220,8 +133,8 @@ function _afform_html_civix_insert_navigation_menu(&$menu, $path, $item) { if (empty($path)) { $menu[] = [ 'attributes' => array_merge([ - 'label' => CRM_Utils_Array::value('name', $item), - 'active' => 1, + 'label' => $item['name'] ?? NULL, + 'active' => 1, ], $item), ]; return TRUE; @@ -285,14 +198,3 @@ function _afform_html_civix_fixNavigationMenuItems(&$nodes, &$maxNavID, $parentI } } } - -/** - * (Delegated) Implements hook_civicrm_entityTypes(). - * - * Find any *.entityType.php files, merge their content, and return. - * - * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_entityTypes - */ -function _afform_html_civix_civicrm_entityTypes(&$entityTypes) { - $entityTypes = array_merge($entityTypes, []); -} diff --git a/ext/afform/html/afform_html.php b/ext/afform/html/afform_html.php index 4410f3eb17..e788accd53 100644 --- a/ext/afform/html/afform_html.php +++ b/ext/afform/html/afform_html.php @@ -25,24 +25,6 @@ function afform_html_civicrm_install() { _afform_html_civix_civicrm_install(); } -/** - * Implements hook_civicrm_postInstall(). - * - * @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_postInstall - */ -function afform_html_civicrm_postInstall() { - _afform_html_civix_civicrm_postInstall(); -} - -/** - * Implements hook_civicrm_uninstall(). - * - * @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_uninstall - */ -function afform_html_civicrm_uninstall() { - _afform_html_civix_civicrm_uninstall(); -} - /** * Implements hook_civicrm_enable(). * @@ -51,32 +33,3 @@ function afform_html_civicrm_uninstall() { function afform_html_civicrm_enable() { _afform_html_civix_civicrm_enable(); } - -/** - * Implements hook_civicrm_disable(). - * - * @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_disable - */ -function afform_html_civicrm_disable() { - _afform_html_civix_civicrm_disable(); -} - -/** - * Implements hook_civicrm_upgrade(). - * - * @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_upgrade - */ -function afform_html_civicrm_upgrade($op, CRM_Queue_Queue $queue = NULL) { - return _afform_html_civix_civicrm_upgrade($op, $queue); -} - -/** - * Implements hook_civicrm_entityTypes(). - * - * Declare entity types provided by this module. - * - * @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_entityTypes - */ -function afform_html_civicrm_entityTypes(&$entityTypes) { - _afform_html_civix_civicrm_entityTypes($entityTypes); -} diff --git a/ext/afform/html/info.xml b/ext/afform/html/info.xml index 930c965677..7e36ae7928 100644 --- a/ext/afform/html/info.xml +++ b/ext/afform/html/info.xml @@ -27,6 +27,9 @@ CRM/AfformHtml - 22.10.0 + 23.02.1 + + + diff --git a/ext/afform/mock/afform_mock.civix.php b/ext/afform/mock/afform_mock.civix.php index 74c34428b1..add2e8811d 100644 --- a/ext/afform/mock/afform_mock.civix.php +++ b/ext/afform/mock/afform_mock.civix.php @@ -84,27 +84,17 @@ use CRM_AfformMock_ExtensionUtil as E; * * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_config */ -function _afform_mock_civix_civicrm_config(&$config = NULL) { +function _afform_mock_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]; - } - $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 +104,7 @@ function _afform_mock_civix_civicrm_config(&$config = NULL) { */ function _afform_mock_civix_civicrm_install() { _afform_mock_civix_civicrm_config(); - if ($upgrader = _afform_mock_civix_upgrader()) { - $upgrader->onInstall(); - } -} - -/** - * Implements hook_civicrm_postInstall(). - * - * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_postInstall - */ -function _afform_mock_civix_civicrm_postInstall() { - _afform_mock_civix_civicrm_config(); - if ($upgrader = _afform_mock_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 _afform_mock_civix_civicrm_uninstall(): void { - _afform_mock_civix_civicrm_config(); - if ($upgrader = _afform_mock_civix_upgrader()) { - $upgrader->onUninstall(); - } + // Based on , this does not currently require mixin/polyfill.php. } /** @@ -152,56 +114,7 @@ function _afform_mock_civix_civicrm_uninstall(): void { */ function _afform_mock_civix_civicrm_enable(): void { _afform_mock_civix_civicrm_config(); - if ($upgrader = _afform_mock_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 _afform_mock_civix_civicrm_disable(): void { - _afform_mock_civix_civicrm_config(); - if ($upgrader = _afform_mock_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 _afform_mock_civix_civicrm_upgrade($op, CRM_Queue_Queue $queue = NULL) { - if ($upgrader = _afform_mock_civix_upgrader()) { - return $upgrader->onUpgrade($op, $queue); - } -} - -/** - * @return CRM_AfformMock_Upgrader - */ -function _afform_mock_civix_upgrader() { - if (!file_exists(__DIR__ . '/CRM/AfformMock/Upgrader.php')) { - return NULL; - } - else { - return CRM_AfformMock_Upgrader_Base::instance(); - } + // Based on , this does not currently require mixin/polyfill.php. } /** @@ -220,8 +133,8 @@ function _afform_mock_civix_insert_navigation_menu(&$menu, $path, $item) { if (empty($path)) { $menu[] = [ 'attributes' => array_merge([ - 'label' => CRM_Utils_Array::value('name', $item), - 'active' => 1, + 'label' => $item['name'] ?? NULL, + 'active' => 1, ], $item), ]; return TRUE; @@ -285,14 +198,3 @@ function _afform_mock_civix_fixNavigationMenuItems(&$nodes, &$maxNavID, $parentI } } } - -/** - * (Delegated) Implements hook_civicrm_entityTypes(). - * - * Find any *.entityType.php files, merge their content, and return. - * - * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_entityTypes - */ -function _afform_mock_civix_civicrm_entityTypes(&$entityTypes) { - $entityTypes = array_merge($entityTypes, []); -} diff --git a/ext/afform/mock/afform_mock.php b/ext/afform/mock/afform_mock.php index 3f6d87a1a9..0ac585f2d4 100644 --- a/ext/afform/mock/afform_mock.php +++ b/ext/afform/mock/afform_mock.php @@ -21,24 +21,6 @@ function afform_mock_civicrm_install() { _afform_mock_civix_civicrm_install(); } -/** - * Implements hook_civicrm_postInstall(). - * - * @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_postInstall - */ -function afform_mock_civicrm_postInstall() { - _afform_mock_civix_civicrm_postInstall(); -} - -/** - * Implements hook_civicrm_uninstall(). - * - * @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_uninstall - */ -function afform_mock_civicrm_uninstall() { - _afform_mock_civix_civicrm_uninstall(); -} - /** * Implements hook_civicrm_enable(). * @@ -47,32 +29,3 @@ function afform_mock_civicrm_uninstall() { function afform_mock_civicrm_enable() { _afform_mock_civix_civicrm_enable(); } - -/** - * Implements hook_civicrm_disable(). - * - * @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_disable - */ -function afform_mock_civicrm_disable() { - _afform_mock_civix_civicrm_disable(); -} - -/** - * Implements hook_civicrm_upgrade(). - * - * @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_upgrade - */ -function afform_mock_civicrm_upgrade($op, CRM_Queue_Queue $queue = NULL) { - return _afform_mock_civix_civicrm_upgrade($op, $queue); -} - -/** - * Implements hook_civicrm_entityTypes(). - * - * Declare entity types provided by this module. - * - * @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_entityTypes - */ -function afform_mock_civicrm_entityTypes(&$entityTypes) { - _afform_mock_civix_civicrm_entityTypes($entityTypes); -} diff --git a/ext/afform/mock/info.xml b/ext/afform/mock/info.xml index 22015e59b2..2a387d0a65 100644 --- a/ext/afform/mock/info.xml +++ b/ext/afform/mock/info.xml @@ -29,6 +29,9 @@ CRM/AfformMock - 22.10.0 + 23.02.1 + + + -- 2.25.1