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

5.48 #22914

Merged
merged 6 commits into from
Mar 9, 2022
Merged

5.48 #22914

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
35 changes: 0 additions & 35 deletions CRM/Upgrade/Incremental/php/FiveFortySeven.php
Original file line number Diff line number Diff line change
Expand Up @@ -213,34 +213,6 @@ public static function migrateCiviGrant(CRM_Queue_TaskContext $ctx): bool {
'name' => 'grant_type',
],
],
'OptionGroup_grant_type_OptionValue_Emergency' => [
'entity' => 'OptionValue',
'values' => [
'option_group_id:name' => 'grant_type',
'name' => 'Emergency',
],
],
'OptionGroup_grant_type_OptionValue_Family Support' => [
'entity' => 'OptionValue',
'values' => [
'option_group_id:name' => 'grant_type',
'name' => 'Family Support',
],
],
'OptionGroup_grant_type_OptionValue_General Protection' => [
'entity' => 'OptionValue',
'values' => [
'option_group_id:name' => 'grant_type',
'name' => 'General Protection',
],
],
'OptionGroup_grant_type_OptionValue_Impunity' => [
'entity' => 'OptionValue',
'values' => [
'option_group_id:name' => 'grant_type',
'name' => 'Impunity',
],
],
'OptionGroup_report_template_OptionValue_CRM_Report_Form_Grant_Detail' => [
'entity' => 'OptionValue',
'values' => [
Expand Down Expand Up @@ -307,13 +279,6 @@ public static function migrateCiviGrant(CRM_Queue_TaskContext $ctx): bool {
'domain_id' => 'current_domain',
],
],
'Navigation_Grants_Navigation_Grant_Reports' => [
'entity' => 'Navigation',
'values' => [
'name' => 'Grant Reports',
'domain_id' => 'current_domain',
],
],
];
// Create an entry in civicrm_managed for each existing record that will be managed by the extension
foreach ($managedItems as $name => $item) {
Expand Down
7 changes: 7 additions & 0 deletions CRM/Upgrade/Incremental/sql/5.48.beta1.mysql.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{* file to handle db changes in 5.48.beta1 during upgrade *}

-- Remove entry for Grant Reports since grant is not a component anymore so this url just shows an empty list
DELETE FROM civicrm_navigation WHERE url='civicrm/report/list?compid=5&reset=1';

DELETE FROM civicrm_managed WHERE module = "civigrant" AND entity_type = "OptionValue"
AND name LIKE "OptionGroup_grant_type_%";
21 changes: 0 additions & 21 deletions ext/civigrant/managed/Navigation_Grants.mgd.php
Original file line number Diff line number Diff line change
Expand Up @@ -151,25 +151,4 @@
],
],
],
[
'name' => 'Navigation_Grants_Navigation_Grant_Reports',
'entity' => 'Navigation',
'cleanup' => 'unused',
'update' => 'unmodified',
'params' => [
'version' => 4,
'values' => [
'label' => 'Grant Reports',
'name' => 'Grant Reports',
'url' => 'civicrm/report/list?compid=5&reset=1',
'icon' => NULL,
'permission' => 'access CiviGrant',
'permission_operator' => '',
'parent_id.name' => 'Grants',
'is_active' => TRUE,
'has_separator' => NULL,
'domain_id' => 'current_domain',
],
],
],
];
112 changes: 0 additions & 112 deletions ext/civigrant/managed/OptionGroup_grant_type.mgd.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,116 +18,4 @@
],
],
],
[
'name' => 'OptionGroup_grant_type_OptionValue_Emergency',
'entity' => 'OptionValue',
'cleanup' => 'unused',
'update' => 'unmodified',
'params' => [
'version' => 4,
'values' => [
'option_group_id.name' => 'grant_type',
'label' => 'Emergency',
'value' => '1',
'name' => 'Emergency',
'grouping' => NULL,
'filter' => 0,
'is_default' => TRUE,
'weight' => 1,
'description' => NULL,
'is_optgroup' => FALSE,
'is_reserved' => FALSE,
'is_active' => TRUE,
'icon' => NULL,
'color' => NULL,
'component_id' => NULL,
'visibility_id' => NULL,
'domain_id' => 'current_domain',
],
],
],
[
'name' => 'OptionGroup_grant_type_OptionValue_Family Support',
'entity' => 'OptionValue',
'cleanup' => 'unused',
'update' => 'unmodified',
'params' => [
'version' => 4,
'values' => [
'option_group_id.name' => 'grant_type',
'label' => 'Family Support',
'value' => '2',
'name' => 'Family Support',
'grouping' => NULL,
'filter' => 0,
'is_default' => FALSE,
'weight' => 2,
'description' => NULL,
'is_optgroup' => FALSE,
'is_reserved' => FALSE,
'is_active' => TRUE,
'icon' => NULL,
'color' => NULL,
'component_id' => NULL,
'visibility_id' => NULL,
'domain_id' => 'current_domain',
],
],
],
[
'name' => 'OptionGroup_grant_type_OptionValue_General Protection',
'entity' => 'OptionValue',
'cleanup' => 'unused',
'update' => 'unmodified',
'params' => [
'version' => 4,
'values' => [
'option_group_id.name' => 'grant_type',
'label' => 'General Protection',
'value' => '3',
'name' => 'General Protection',
'grouping' => NULL,
'filter' => 0,
'is_default' => FALSE,
'weight' => 3,
'description' => NULL,
'is_optgroup' => FALSE,
'is_reserved' => FALSE,
'is_active' => TRUE,
'icon' => NULL,
'color' => NULL,
'component_id' => NULL,
'visibility_id' => NULL,
'domain_id' => 'current_domain',
],
],
],
[
'name' => 'OptionGroup_grant_type_OptionValue_Impunity',
'entity' => 'OptionValue',
'cleanup' => 'unused',
'update' => 'unmodified',
'params' => [
'version' => 4,
'values' => [
'option_group_id.name' => 'grant_type',
'label' => 'Impunity',
'value' => '4',
'name' => 'Impunity',
'grouping' => NULL,
'filter' => 0,
'is_default' => FALSE,
'weight' => 4,
'description' => NULL,
'is_optgroup' => FALSE,
'is_reserved' => FALSE,
'is_active' => TRUE,
'icon' => NULL,
'color' => NULL,
'component_id' => NULL,
'visibility_id' => NULL,
'domain_id' => 'current_domain',
],
],
],
];
11 changes: 9 additions & 2 deletions ext/civigrant/tests/phpunit/api/v3/GrantTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,10 @@
* @subpackage API_Grant
* @group headless
*/
class api_v3_GrantTest extends \PHPUnit\Framework\TestCase implements \Civi\Test\HeadlessInterface {
class api_v3_GrantTest extends \PHPUnit\Framework\TestCase implements \Civi\Test\HeadlessInterface, \Civi\Test\TransactionalInterface {
use \Civi\Test\Api3TestTrait;
use \Civi\Test\ContactTestTrait;


protected $_apiversion = 3;
protected $params;
protected $ids = [];
Expand Down Expand Up @@ -48,6 +47,14 @@ public function setUp(): void {
'currency' => 'USD',
'grant_type_id' => 1,
];
// Create a sample grant type
\CRM_Core_BAO_OptionValue::ensureOptionValueExists([
'option_group_id' => 'grant_type',
'label' => 'Emergency',
'name' => 'Emergency',
'value' => 1,
'is_active' => 1,
]);
}

/**
Expand Down
Loading