Skip to content

Commit

Permalink
Merge pull request #27697 from mlutfy/fixMailingMenuLabels
Browse files Browse the repository at this point in the history
Upgrade: rename the Draft/Sent Mailing menu labels
  • Loading branch information
colemanw authored Sep 30, 2023
2 parents 72c9f0c + 2ea2696 commit c53c1b2
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion CRM/Upgrade/Incremental/php/FiveSixtySeven.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,29 @@ public function upgrade_5_67_alpha1($rev): void {
$this->addTask('Add cache_fill_took column to Group table', 'addColumn', 'civicrm_group', 'cache_fill_took',
'DOUBLE DEFAULT NULL COMMENT "Seconds taken to fill smart group cache, not always related to cache_date"',
FALSE);
$this->addTask('Update civicrm_mailing_event_queue to permit deleting records from civicrm_mailing_job', 'updateMailingEventQueueTable', 'updateMailingEventQueueTable');
$this->addTask('Update civicrm_mailing_event_queue to permit deleting records from civicrm_mailing_job', 'updateMailingEventQueueTable');
$this->addTask('Update CiviMail menus labels', 'updateMailingMenuLabels');
}

/**
* Some time ago, the labels for Mailing menu items were simplified for new
* installs. Now that the old strings have been removed from Transifex, it
* breaks translations, so we force the update, but only if the label was not
* customized (if name=label).
*/
public static function updateMailingMenuLabels(CRM_Queue_TaskContext $ctx): bool {
$changes = [
'Draft and Unscheduled Mailings' => 'Draft Mailings',
'Scheduled and Sent Mailings' => 'Sent Mailings',
];
foreach ($changes as $old => $new) {
CRM_Core_DAO::executeQuery('UPDATE civicrm_navigation SET label = %1 WHERE name = %2 AND label = %3', [
1 => [$new, 'String'],
2 => [$old, 'String'],
3 => [$old, 'String'],
]);
}
return TRUE;
}

/**
Expand Down

0 comments on commit c53c1b2

Please sign in to comment.