Skip to content

Commit

Permalink
Merge pull request #20809 from totten/master-fwd
Browse files Browse the repository at this point in the history
Merge forward 5.39 => master
  • Loading branch information
totten authored Jul 8, 2021
2 parents 18bb23f + a9b847e commit e93a814
Show file tree
Hide file tree
Showing 4 changed files with 99 additions and 81 deletions.
86 changes: 71 additions & 15 deletions CRM/Upgrade/Incremental/php/FiveThirtyNine.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,21 +55,77 @@ public function setPostUpgradeMessage(&$postUpgradeMessage, $rev) {
* (change the x in the function name):
*/

// /**
// * Upgrade function.
// *
// * @param string $rev
// */
// public function upgrade_5_0_x($rev) {
// $this->addTask(ts('Upgrade DB to %1: SQL', [1 => $rev]), 'runSql', $rev);
// $this->addTask('Do the foo change', 'taskFoo', ...);
// // Additional tasks here...
// // Note: do not use ts() in the addTask description because it adds unnecessary strings to transifex.
// // The above is an exception because 'Upgrade DB to %1: SQL' is generic & reusable.
// }
/**
* Upgrade function.
*
* @param string $rev
*/
public function upgrade_5_39_alpha1($rev) {
$this->addTask(ts('Upgrade DB to %1: SQL', [1 => $rev]), 'runSql', $rev);
$this->addTask('Update smart groups to rename filters on case_from and case_to to case_start_date and case_end_date', 'updateSmartGroups', [
'renameField' => [
['old' => 'case_from_relative', 'new' => 'case_start_date_relative'],
['old' => 'case_from_start_date_high', 'new' => 'case_start_date_high'],
['old' => 'case_from_start_date_low', 'new' => 'case_start_date_low'],
['old' => 'case_to_relative', 'new' => 'case_end_date_relative'],
['old' => 'case_to_end_date_high', 'new' => 'case_end_date_high'],
['old' => 'case_to_end_date_low', 'new' => 'case_end_date_low'],
[
'old' => 'mailing_date_relative',
'new' => 'mailing_job_start_date_relative',
],
['old' => 'mailing_date_high', 'new' => 'mailing_job_start_date_high'],
['old' => 'mailing_date_low', 'new' => 'mailing_job_start_date_low'],
[
'old' => 'relation_start_date_low',
'new' => 'relationship_start_date_low',
],
[
'old' => 'relation_start_date_high',
'new' => 'relationship_start_date_high',
],
[
'old' => 'relation_start_date_relative',
'new' => 'relationship_start_date_relative',
],
[
'old' => 'relation_end_date_low',
'new' => 'relationship_end_date_low',
],
[
'old' => 'relation_end_date_high',
'new' => 'relationship_end_date_high',
],
[
'old' => 'relation_end_date_relative',
'new' => 'relationship_end_date_relative',
],
['old' => 'event_start_date_low', 'new' => 'event_low'],
['old' => 'event_end_date_high', 'new' => 'event_high'],
],
]);
$this->addTask('Update smart groups where jcalendar fields have been converted to datepicker', 'updateSmartGroups', [
'datepickerConversion' => [
'birth_date',
'deceased_date',
'case_start_date',
'case_end_date',
'mailing_job_start_date',
'relationship_start_date',
'relationship_end_date',
'event',
'relation_active_period_date',
'created_date',
'modified_date',
],
]);

// public static function taskFoo(CRM_Queue_TaskContext $ctx, ...) {
// return TRUE;
// }
$this->addTask('Convert Log date searches to their final names either created date or modified date', 'updateSmartGroups', [
'renameLogFields' => [],
]);
$this->addTask('Convert Custom data based smart groups from jcalendar to datepicker', 'updateSmartGroups', [
'convertCustomSmartGroups' => NULL,
]);
}

}
42 changes: 0 additions & 42 deletions CRM/Upgrade/Incremental/php/FiveTwenty.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,49 +93,7 @@ public function upgrade_5_20_alpha1($rev) {
}
$this->addTask(ts('Upgrade DB to %1: SQL', [1 => $rev]), 'runSql', $rev);
$this->addTask('Add "Template" contribution status', 'templateStatus');
$this->addTask('Update smart groups to rename filters on case_from and case_to to case_start_date and case_end_date', 'updateSmartGroups', [
'renameField' => [
['old' => 'case_from_relative', 'new' => 'case_start_date_relative'],
['old' => 'case_from_start_date_high', 'new' => 'case_start_date_high'],
['old' => 'case_from_start_date_low', 'new' => 'case_start_date_low'],
['old' => 'case_to_relative', 'new' => 'case_end_date_relative'],
['old' => 'case_to_end_date_high', 'new' => 'case_end_date_high'],
['old' => 'case_to_end_date_low', 'new' => 'case_end_date_low'],
['old' => 'mailing_date_relative', 'new' => 'mailing_job_start_date_relative'],
['old' => 'mailing_date_high', 'new' => 'mailing_job_start_date_high'],
['old' => 'mailing_date_low', 'new' => 'mailing_job_start_date_low'],
['old' => 'relation_start_date_low', 'new' => 'relationship_start_date_low'],
['old' => 'relation_start_date_high', 'new' => 'relationship_start_date_high'],
['old' => 'relation_start_date_relative', 'new' => 'relationship_start_date_relative'],
['old' => 'relation_end_date_low', 'new' => 'relationship_end_date_low'],
['old' => 'relation_end_date_high', 'new' => 'relationship_end_date_high'],
['old' => 'relation_end_date_relative', 'new' => 'relationship_end_date_relative'],
['old' => 'event_start_date_low', 'new' => 'event_low'],
['old' => 'event_end_date_high', 'new' => 'event_high'],
],
]);
$this->addTask('Convert Log date searches to their final names either created date or modified date', 'updateSmartGroups', [
'renameLogFields' => [],
]);
$this->addTask('Update smart groups where jcalendar fields have been converted to datepicker', 'updateSmartGroups', [
'datepickerConversion' => [
'birth_date',
'deceased_date',
'case_start_date',
'case_end_date',
'mailing_job_start_date',
'relationship_start_date',
'relationship_end_date',
'event',
'relation_active_period_date',
'created_date',
'modified_date',
],
]);
$this->addTask('Clean up unused table "civicrm_persistent"', 'dropTableIfEmpty', 'civicrm_persistent');
$this->addTask('Convert Custom data based smart groups from jcalendar to datepicker', 'updateSmartGroups', [
'convertCustomSmartGroups' => NULL,
]);
}

public static function templateStatus(CRM_Queue_TaskContext $ctx) {
Expand Down
47 changes: 25 additions & 22 deletions release-notes/5.39.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ Released July 7, 2021

### Core CiviCRM

- **Proposal - Separation of Default Language for contacts from the default
Language (Work Towards
- **Separate the default language for contacts from the site language (Work Towards
[dev/core#2584](https://lab.civicrm.org/dev/core/-/issues/2584):
[20214](https://github.com/civicrm/civicrm-core/pull/20214))**

Expand All @@ -37,7 +36,7 @@ Released July 7, 2021
[dev/translation#67](https://lab.civicrm.org/dev/translation/-/issues/67):
[20478](https://github.com/civicrm/civicrm-core/pull/20478))**

Defines a "Translation" `civicrm_translation` table, to represent a single
Defines a "Translation" table (`civicrm_translation`), to represent a single
translated string (e.g. a translated message-title or a translated
event-description).

Expand All @@ -48,7 +47,7 @@ Released July 7, 2021

Creates a setting to define the number of search results to be returned.

- **Give the custom css file a 'name' to make it easier to manipulate in
- **Give the custom CSS file a 'name' to make it easier to manipulate in
hook_civicrm_alterBundle()
([20278](https://github.com/civicrm/civicrm-core/pull/20278))**

Expand Down Expand Up @@ -151,7 +150,7 @@ Released July 7, 2021
- **Use PHPUnit8 in main test suites
([20370](https://github.com/civicrm/civicrm-core/pull/20370))**

Makes phpunit8 the default test runner for php versions greater than 7.2 for
Makes phpunit8 the default test runner for PHP versions greater than 7.2 for
the core test suites.

- **Link styling with default greenwich theme is not linklike on search kit
Expand Down Expand Up @@ -277,7 +276,7 @@ Released July 7, 2021
[20528](https://github.com/civicrm/civicrm-core/pull/20528))**

Fixes an 'access denied' error on standalone SearchKit export forms, caused by
renaming the php classes.
renaming the PHP classes.

- **500 error saving Search Kit Smart Group sorted on aggregated field
([dev/report#68](https://lab.civicrm.org/dev/report/-/issues/68):
Expand All @@ -291,13 +290,17 @@ Released July 7, 2021
([dev/core#2479](https://lab.civicrm.org/dev/core/-/issues/2479):
[20059](https://github.com/civicrm/civicrm-core/pull/20059))**

- **Fatal error while upgrading smart-group data
([dev/core#2659](https://lab.civicrm.org/dev/core/-/issues/2659):
[20756](https://github.com/civicrm/civicrm-core/pull/20756/))**

- **CRM_Utils_File::isAbsolute does not respect PHP stream wrappers (Work
Towards [dev/core#2590](https://lab.civicrm.org/dev/core/-/issues/2590):
[20270](https://github.com/civicrm/civicrm-core/pull/20270))**

Removes unused function.

- **Installer doesn't check mysql version properly
- **Installer doesn't check MySQL version properly
([dev/core#2602](https://lab.civicrm.org/dev/core/-/issues/2602):
[20255](https://github.com/civicrm/civicrm-core/pull/20255))**

Expand Down Expand Up @@ -347,7 +350,7 @@ Released July 7, 2021
optional parameters in function declaration
([20515](https://github.com/civicrm/civicrm-core/pull/20515))**

- **[php8-compat] Fix php beautifier notice by conditionally assigning dynamic
- **[php8-compat] Fix PHP Beautifier notice by conditionally assigning dynamic
foreign key to the template
([20509](https://github.com/civicrm/civicrm-core/pull/20509))**

Expand All @@ -360,7 +363,7 @@ Released July 7, 2021
spaceship operator
([20502](https://github.com/civicrm/civicrm-core/pull/20502))**

- **[php8-compat] fix Upgrade call back issues by making functions static and
- **[php8-compat] Fix Upgrade call back issues by making functions static and
also fixing an issue with an array key not existing when checking obsolete
extensions ([20503](https://github.com/civicrm/civicrm-core/pull/20503))**

Expand Down Expand Up @@ -410,7 +413,7 @@ Released July 7, 2021
- **Fix mandatory keys check fail for value of float 0.0 in a required key in an
entity ([20342](https://github.com/civicrm/civicrm-core/pull/20342))**

- **Fix extraneous white space in generated sql
- **Fix extraneous white space in generated SQL
([20340](https://github.com/civicrm/civicrm-core/pull/20340))**

- **Fix case sensitive parameter for call to getCustomFieldTokens
Expand All @@ -425,10 +428,10 @@ Released July 7, 2021
- **Explicitly throw an error/status bounce on Edit/New if no types.
([19840](https://github.com/civicrm/civicrm-core/pull/19840))**

- **Core_DAO - fire links_callback for all entities
- **Core_DAO - Fire links_callback for all entities
([20332](https://github.com/civicrm/civicrm-core/pull/20332))**

- **get county fields populated via api call
- **Get county fields populated via api call
([20309](https://github.com/civicrm/civicrm-core/pull/20309))**

Ensure that county fields are properly populated when calling the
Expand Down Expand Up @@ -456,7 +459,7 @@ Released July 7, 2021
- **Fix delete customgroup using API4 so it removes data table
([20265](https://github.com/civicrm/civicrm-core/pull/20265))**

- **hook_managed - do not try to disable managed entities if is_active is not
- **hook_managed - Do not try to disable managed entities if is_active is not
available to api3.create
([20144](https://github.com/civicrm/civicrm-core/pull/20144))**

Expand Down Expand Up @@ -656,7 +659,7 @@ Released July 7, 2021
message templates
([20520](https://github.com/civicrm/civicrm-core/pull/20520))**

- **[php8-compat] Update smarty templates and some php files to get the
- **[php8-compat] Update smarty templates and some PHP files to get the
api_v3_contribution testclass to pass on php8
([20512](https://github.com/civicrm/civicrm-core/pull/20512))**

Expand Down Expand Up @@ -765,7 +768,7 @@ Released July 7, 2021
([dev/core#1744](https://lab.civicrm.org/dev/core/-/issues/1744):
[20555](https://github.com/civicrm/civicrm-core/pull/20555))**

- **[REF] extract function to get locks
- **[REF] Extract function to get locks
([20373](https://github.com/civicrm/civicrm-core/pull/20373))**

- **[REF] Remove unused variable
Expand All @@ -777,7 +780,7 @@ Released July 7, 2021
- **[REF] Extract code to transfer groups from temp table to cache
([20435](https://github.com/civicrm/civicrm-core/pull/20435))**

- **[Ref] remove never-passed param
- **[REF] Remove never-passed param
([20456](https://github.com/civicrm/civicrm-core/pull/20456))**

- **[REF] APIv4 refactoring to support calculated fields
Expand All @@ -786,7 +789,7 @@ Released July 7, 2021
- **[REF] Set receipt_date after sending, (from batch) not in anticipation
([20395](https://github.com/civicrm/civicrm-core/pull/20395))**

- **[REF] minor extraction - getInfoUrl
- **[REF] Minor extraction - getInfoUrl
([20421](https://github.com/civicrm/civicrm-core/pull/20421))**

- **[REF] Fix issue where by mailing urls were always stuck in the original
Expand All @@ -799,13 +802,13 @@ Released July 7, 2021
- **[REF] Stop passing unneed params to the recur function
([20412](https://github.com/civicrm/civicrm-core/pull/20412))**

- **[REF] replace isFirst parameter
- **[REF] Replace isFirst parameter
([20411](https://github.com/civicrm/civicrm-core/pull/20411))**

- **[REF] Remove now-unused params
([20410](https://github.com/civicrm/civicrm-core/pull/20410))**

- **[REF] Paypal ipn - cleanup references to completion
- **[REF] Paypal IPN - Cleanup references to completion
([20407](https://github.com/civicrm/civicrm-core/pull/20407))**

- **[REF] Replace deprecated code call
Expand Down Expand Up @@ -854,13 +857,13 @@ Released July 7, 2021
- **(REF) Regen CRM/Core/DAO/CustomField.php
([20337](https://github.com/civicrm/civicrm-core/pull/20337))**

- **[Ref] remove redundant call to clearGroupContactCache
- **[REF] Remove redundant call to clearGroupContactCache
([20243](https://github.com/civicrm/civicrm-core/pull/20243))**

- **[Ref] [tests only] replace direct calls to enable logging with calls to the
- **[REF] [tests only] Replace direct calls to enable logging with calls to the
setting ([20460](https://github.com/civicrm/civicrm-core/pull/20460))**

- **[Ref] Remove function parameter only used from test
- **[REF] Remove function parameter only used from test
([20459](https://github.com/civicrm/civicrm-core/pull/20459))**

- **[REF] Extract code determining list of groups requiring a refresh
Expand Down
5 changes: 3 additions & 2 deletions tools/bin/scripts/set-version.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@
return str_replace($oldVersion, $newVersion, $content);
});

foreach (findCoreInfoXml() as $infoXml) {
$infoXmls = findCoreInfoXml();
foreach ($infoXmls as $infoXml) {
updateXmlFile($infoXml, function (DOMDocument $dom) use ($newVersion) {
foreach ($dom->getElementsByTagName('version') as $tag) {
/** @var \DOMNode $tag */
Expand All @@ -85,7 +86,7 @@

if ($doCommit) {
$files = array_filter(
['xml/version.xml', 'sql/civicrm_generated.mysql', 'sql/test_data_second_domain.mysql', $phpFile, @$sqlFile],
array_merge(['xml/version.xml', 'sql/civicrm_generated.mysql', 'sql/test_data_second_domain.mysql', $phpFile, @$sqlFile], $infoXmls),
'file_exists'
);
$filesEsc = implode(' ', array_map('escapeshellarg', $files));
Expand Down

0 comments on commit e93a814

Please sign in to comment.