Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#4360 #4384 fixing multiple regressions with path civicrm/contact/search #26669

Merged
merged 3 commits into from
Jul 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions ext/civicrm_admin_ui/CRM/CivicrmAdminUi/Upgrader.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?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();
}

/**
* @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 {
colemanw marked this conversation as resolved.
Show resolved Hide resolved
$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;
}

}
2 changes: 1 addition & 1 deletion ext/civicrm_admin_ui/ang/afsearchContactSearch.aff.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"type": "search",
"title": "Find Contacts",
"icon": "fa-list-alt",
"server_route": "civicrm/contact/search",
"server_route": "civicrm/adminui/contact/search",
"permission": "access CiviCRM",
"navigation": null,
"requires": [],
Expand Down
4 changes: 2 additions & 2 deletions ext/civicrm_admin_ui/civicrm_admin_ui.civix.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,8 @@ function _civicrm_admin_ui_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;
Expand Down
3 changes: 2 additions & 1 deletion ext/civicrm_admin_ui/info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,10 @@
<civix>
<namespace>CRM/CivicrmAdminUi</namespace>
<angularModule>crmCivicrmAdminUi</angularModule>
<format>23.02.0</format>
<format>23.02.1</format>
</civix>
<mixins>
<mixin>[email protected]</mixin>
</mixins>
<upgrader>CRM_CivicrmAdminUi_Upgrader</upgrader>
</extension>