*/
class CRM_CivicrmAdminUi_Upgrader extends CRM_Extension_Upgrader_Base {
- protected function replaceFindContactMenuPath($path) {
- // point Find Contacts menu to the FB/SK version or back to the original path
- // this is temporary until everything is in FB/SK and we can use the original path
- $results = \Civi\Api4\Navigation::update(FALSE)
- ->addValue('url', $path)
- ->addWhere('name', '=', 'Find Contacts')
- ->execute();
- }
-
- /**
- * @todo "install" and "uninstall" may not be needed if enable and disable are present. See https://github.com/civicrm/civicrm-core/pull/26669
- */
- public function install(): void {
- $this->replaceFindContactMenuPath('civicrm/adminui/contact/search');
- }
-
- public function uninstall(): void {
- $this->replaceFindContactMenuPath('civicrm/contact/search');
- }
-
- public function enable(): void {
- $this->replaceFindContactMenuPath('civicrm/adminui/contact/search');
- }
-
- public function disable(): void {
- $this->replaceFindContactMenuPath('civicrm/contact/search');
- }
-
- public function upgrade_1000(): bool {
- $this->replaceFindContactMenuPath('civicrm/adminui/contact/search');
- return TRUE;
- }
-
}
--- /dev/null
+<?php
+// phpcs:disable
+use CRM_CivicrmSearchUi_ExtensionUtil as E;
+// phpcs:enable
+
+/**
+ * Collection of upgrade steps.
+ */
+class CRM_CivicrmSearchUi_Upgrader extends CRM_Extension_Upgrader_Base {
+
+ protected function replaceFindContactMenuPath($path) {
+ // point Find Contacts menu to the FB/SK version or back to the original path
+ // this is temporary until everything is in FB/SK and we can use the original path
+ $results = \Civi\Api4\Navigation::update(FALSE)
+ ->addValue('url', $path)
+ ->addWhere('name', '=', 'Find Contacts')
+ ->execute();
+ }
+
+ /**
+ * See https://github.com/civicrm/civicrm-core/pull/26669
+ */
+ public function enable(): void {
+ $this->replaceFindContactMenuPath('civicrm/searchui/contact/search');
+ }
+
+ public function disable(): void {
+ $this->replaceFindContactMenuPath('civicrm/contact/search');
+ }
+
+ public function upgrade_1000(): bool {
+ $this->replaceFindContactMenuPath('civicrm/searchui/contact/search');
+ return TRUE;
+ }
+
+}
"type": "search",
"title": "Find Contacts",
"icon": "fa-list-alt",
- "server_route": "civicrm/adminui/contact/search",
+ "server_route": "civicrm/searchui/contact/search",
"permission": "access CiviCRM",
"navigation": null,
"requires": [],
<mixin>setting-php@1.0.0</mixin>
<mixin>smarty-v2@1.0.1</mixin>
</mixins>
+ <upgrader>CRM_CivicrmSearchUi_Upgrader</upgrader>
</extension>