Skip to content

Commit

Permalink
COMCL-707: Fix case type category terms
Browse files Browse the repository at this point in the history
  • Loading branch information
Muhammad Shahrukh committed Sep 4, 2024
1 parent 949cc84 commit eb77f82
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 36 deletions.
2 changes: 1 addition & 1 deletion CRM/Civicase/Event/Listener/AssetBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class CRM_Civicase_Event_Listener_AssetBuilder {
*/
public static function addWordReplacements(GenericHookEvent $event) {
if ($event->asset == 'angular-modules.json') {
$caseCategoryName = \Civi::cache('metadata')->get('current_case_category');
$caseCategoryName = CRM_Core_Session::singleton()->get('current_case_category');
CRM_Civicase_Hook_Helper_CaseTypeCategory::addWordReplacements($caseCategoryName);

// Rebuild the asset if it has been built.
Expand Down
2 changes: 1 addition & 1 deletion CRM/Civicase/Hook/Helper/CaseTypeCategory.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public static function addWordReplacements($caseCategoryName) {
}

CRM_Core_Resources::singleton()->flushStrings()->resetCacheCode();
\Civi::cache('metadata')->set('current_case_category', $caseCategoryName);
CRM_Core_Session::singleton()->set('current_case_category', $caseCategoryName);
$wordReplacements = CaseCategoryHelper::getWordReplacements($caseCategoryName);
if (empty($wordReplacements)) {
return;
Expand Down
33 changes: 0 additions & 33 deletions CRM/Civicase/Hook/PageRun/AddCaseTypeCategoryToCache.php

This file was deleted.

1 change: 1 addition & 0 deletions CRM/Civicase/Settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public static function getAll(): array {

[$caseCategoryId, $caseCategoryName] = CaseUrlHelper::getCategoryParamsFromUrl();

CRM_Civicase_Hook_Helper_CaseTypeCategory::addWordReplacements($caseCategoryName);
$permissionService = new CaseCategoryPermission();
$caseCategoryPermissions = $permissionService->get($caseCategoryName);
$caseCategorySetting = new CRM_Civicase_Service_CaseCategorySetting();
Expand Down
1 change: 0 additions & 1 deletion civicase.php
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,6 @@ function civicase_civicrm_pageRun(&$page) {
new CRM_Civicase_Hook_PageRun_AddCaseAngularPageResources(),
new CRM_Civicase_Hook_PageRun_AddContactPageSummaryResources(),
new CRM_Civicase_Hook_PageRun_CaseCategoryCustomGroupListing(),
new CRM_Civicase_Hook_PageRun_AddCaseTypeCategoryToCache(),
];

foreach ($hooks as $hook) {
Expand Down

0 comments on commit eb77f82

Please sign in to comment.