--- /dev/null
+<?php
+// phpcs:disable
+use CRM_CivicrmAdminUi_ExtensionUtil as E;
+// phpcs:enable
+
+/**
+ * Collection of upgrade steps.
+ */
+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();
+ }
+
+ 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;
+ }
+
+}
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;
<civix>
<namespace>CRM/CivicrmAdminUi</namespace>
<angularModule>crmCivicrmAdminUi</angularModule>
- <format>23.02.0</format>
+ <format>23.02.1</format>
</civix>
<mixins>
<mixin>mgd-php@1.0.0</mixin>
</mixins>
+ <upgrader>CRM_CivicrmAdminUi_Upgrader</upgrader>
</extension>
use CRM_CivicrmAdminUi_ExtensionUtil as E;
return [
- // using a temporary alternate path to avoid breaking legacy path
- [
- 'name' => 'Navigation_Find_Contacts',
- 'entity' => 'Navigation',
- 'cleanup' => 'unused',
- 'update' => 'unmodified',
- 'params' => [
- 'version' => 4,
- 'values' => [
- 'domain_id' => 'current_domain',
- 'label' => E::ts('Find Contacts'),
- 'name' => 'Find Contacts',
- 'url' => 'civicrm/adminui/contact/search',
- 'icon' => NULL,
- 'permission' => NULL,
- 'permission_operator' => '',
- 'parent_id.name' => 'Search',
- 'is_active' => TRUE,
- 'has_separator' => NULL,
- 'weight' => 1,
- ],
- 'match' => [
- 'name',
- ],
- ],
- ],
[
'name' => 'SavedSearch_Find_Contacts',
'entity' => 'SavedSearch',