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

dev/core#927 Enable contribution cancel actions extension #18812

Merged
merged 1 commit into from
Oct 21, 2020
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
33 changes: 33 additions & 0 deletions CRM/Upgrade/Incremental/php/FiveThirtyTwo.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,38 @@ public function setPostUpgradeMessage(&$postUpgradeMessage, $rev) {
// }
}

/**
* Install contributioncancelactions extension.
*
* This feature is restructured as a core extension - which is primarily a code cleanup step but
* also permits sites / extensions to disable the core actions to do their own workflows.
*
* @param \CRM_Queue_TaskContext $ctx
*
* @return bool
*
* @throws \CRM_Core_Exception
*/
public static function installContributionCancelActions(CRM_Queue_TaskContext $ctx) {
// Install via direct SQL manipulation. Note that:
// (1) This extension has no activation logic.
// (2) On new installs, the extension is activated purely via default SQL INSERT.
// (3) Caches are flushed at the end of the upgrade.
// ($) Over long term, upgrade steps are more reliable in SQL. API/BAO sometimes don't work mid-upgrade.
$insert = CRM_Utils_SQL_Insert::into('civicrm_extension')->row([
'type' => 'module',
'full_name' => 'contributioncancelactions',
'name' => 'contributioncancelactions',
'label' => 'Contribution cancel actions',
'file' => 'contributioncancelactions',
'schema_version' => NULL,
'is_active' => 1,
]);
CRM_Core_DAO::executeQuery($insert->usingReplace()->toSQL());

return TRUE;
}

/**
* Upgrade function.
*
Expand All @@ -57,6 +89,7 @@ public function upgrade_5_32_alpha1($rev) {
$this->addTask('Add column civicrm_saved_search.name', 'addColumn', 'civicrm_saved_search', 'name', "varchar(255) DEFAULT NULL COMMENT 'Unique name of saved search'");
$this->addTask('Add column civicrm_saved_search.label', 'addColumn', 'civicrm_saved_search', 'label', "varchar(255) DEFAULT NULL COMMENT 'Administrative label for search'");
$this->addTask('Add index civicrm_saved_search.UI_name', 'addIndex', 'civicrm_saved_search', 'name', 'UI');
$this->addTask('Install contribution cancel actions extension', 'installContributionCancelActions');
}

}
1 change: 1 addition & 0 deletions xml/templates/civicrm_data.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -1782,3 +1782,4 @@ INSERT IGNORE INTO civicrm_extension (type, full_name, name, label, file, is_act
INSERT IGNORE INTO civicrm_extension (type, full_name, name, label, file, is_active) VALUES ('module', 'greenwich', 'Theme: Greenwich', 'Theme: Greenwich', 'greenwich', 1);
INSERT IGNORE INTO civicrm_extension (type, full_name, name, label, file, is_active) VALUES ('module', 'eventcart', 'Event cart', 'Event cart', 'eventcart', 1);
INSERT IGNORE INTO civicrm_extension (type, full_name, name, label, file, is_active) VALUES ('module', 'financialacls', 'Financial ACLs', 'Financial ACLs', 'financialacls', 1);
INSERT IGNORE INTO civicrm_extension (type, full_name, name, label, file, is_active) VALUES ('module', 'contributioncancelactions', 'Contribution cancel actions', 'Contribution cancel actions', 'contributioncancelactions', 1);