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 2ff0941
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 37 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.

3 changes: 2 additions & 1 deletion CRM/Civicase/Settings.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?php

use Civi\CCase\Utils as Utils;
use CRM_Civicase_Helper_CaseUrl as CaseUrlHelper;
use CRM_Civicase_Helper_NewCaseWebform as NewCaseWebform;
use CRM_Civicase_Helper_OptionValues as OptionValuesHelper;
use CRM_Civicase_Hook_Permissions_ExportCasesAndReports as ExportCasesAndReports;
use CRM_Civicase_Service_CaseCategoryCustomFieldsSetting as CaseCategoryCustomFieldsSetting;
use CRM_Civicase_Service_CaseCategoryPermission as CaseCategoryPermission;
use Civi\CCase\Utils as Utils;

/**
* Get a list of settings for angular pages.
Expand All @@ -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 2ff0941

Please sign in to comment.