colemanw [Fri, 6 Nov 2020 00:50:49 +0000 (19:50 -0500)]
Merge pull request #18932 from colemanw/schemaHandler
Schema handler fixes
Seamus Lee [Thu, 5 Nov 2020 22:46:44 +0000 (09:46 +1100)]
Merge pull request #18931 from seamuslee001/master
5.31
Seamus Lee [Thu, 5 Nov 2020 22:45:31 +0000 (09:45 +1100)]
Merge in 5.31
Eileen McNaughton [Thu, 5 Nov 2020 22:40:19 +0000 (11:40 +1300)]
Merge pull request #18925 from totten/5.31-revert-titlereq
dev/translation#58 - Fix regression. Partially revert schema for civicrm_group.title
Coleman Watts [Thu, 5 Nov 2020 22:36:52 +0000 (17:36 -0500)]
CustomField - simplify tableName lookup during bulkSave and fix bug
This cleans up the tableName lookup to use the method used throughout this class.
The extra optimization (local caching in the $tables variable) was actually less efficient
because CRM_Core_DAO::getFieldValue caches its results, and is used elsewhere so the value
is likely to already be cached.
The bug is that the same table name was repeatedly being passed into $logging->fixSchemaDifferencesFor().
Coleman Watts [Thu, 5 Nov 2020 22:31:35 +0000 (17:31 -0500)]
SchemaHandler - Remove unused/deprecated function
Matthew Wire [Thu, 5 Nov 2020 21:53:29 +0000 (21:53 +0000)]
Merge pull request #18930 from MegaphoneJon/financial-156
closes financial/#156: Set contribution status to refunded even if cancelled_payment_id is set
Jon Goldberg [Thu, 5 Nov 2020 19:24:38 +0000 (14:24 -0500)]
closes financial/#156: Set contribution status to refunded even if cancelled_payment_id is set
colemanw [Thu, 5 Nov 2020 18:07:29 +0000 (13:07 -0500)]
Merge pull request #18928 from demeritcowboy/left-right-up-down
dev/core#2167 - Fulltext search drupal block has button on wrong side
colemanw [Thu, 5 Nov 2020 18:07:13 +0000 (13:07 -0500)]
Merge pull request #18927 from demeritcowboy/del-mail
dev/core#2166 - E_NOTICE when deleting mail account
demeritcowboy [Thu, 5 Nov 2020 15:12:36 +0000 (10:12 -0500)]
button placement on fulltext search drupal block
demeritcowboy [Thu, 5 Nov 2020 14:43:34 +0000 (09:43 -0500)]
avoid notice / skip validation when deleting
Tim Otten [Thu, 5 Nov 2020 11:59:23 +0000 (03:59 -0800)]
dev/translation#58 - 5.31.beta2 - Undo 'NOT NULL'
CiviCRM [Thu, 5 Nov 2020 11:58:32 +0000 (03:58 -0800)]
Set version to 5.31.beta2
Tim Otten [Thu, 5 Nov 2020 11:39:32 +0000 (03:39 -0800)]
dev/translation#58 - Partially revert schema for civicrm_group.title
Eileen McNaughton [Thu, 5 Nov 2020 07:20:02 +0000 (20:20 +1300)]
Merge pull request #18911 from totten/master-mail-test
dev/mail#2141 - MailSettings - Add button+API for testing a connection
Eileen McNaughton [Wed, 4 Nov 2020 22:50:40 +0000 (11:50 +1300)]
Merge pull request #18923 from civicrm/5.31
5.31 to master
Eileen McNaughton [Wed, 4 Nov 2020 22:50:11 +0000 (11:50 +1300)]
Merge pull request #18921 from agh1/5.31.0-releasenotes-final
5.31.0 release notes final
Eileen McNaughton [Wed, 4 Nov 2020 19:45:48 +0000 (08:45 +1300)]
Merge pull request #18917 from mattwire/financialtrxn_payprocid
Add UI metadata for payment_processor_id on financialTrxn
Andrew Hunt [Wed, 4 Nov 2020 19:36:05 +0000 (14:36 -0500)]
5.31.0 release notes: added late changes
Andrew Hunt [Wed, 4 Nov 2020 18:58:05 +0000 (13:58 -0500)]
5.31.0 release notes: misc edits
colemanw [Wed, 4 Nov 2020 13:55:08 +0000 (08:55 -0500)]
Merge pull request #18907 from alifrumin/2139
dev/core#2139 fix defaulting for multi-select custom fields
Eileen McNaughton [Wed, 4 Nov 2020 06:14:49 +0000 (19:14 +1300)]
Merge pull request #18919 from colemanw/searchKitValidate
Search ext: Fix validation and saving on search admin screen
Coleman Watts [Wed, 4 Nov 2020 03:25:58 +0000 (22:25 -0500)]
Search ext: Fix validation and saving on search admin screen
Matthew Wire [Tue, 3 Nov 2020 22:02:28 +0000 (22:02 +0000)]
Add UI metadata for payment_processor_id on financialTrxn
Eileen McNaughton [Tue, 3 Nov 2020 19:39:49 +0000 (08:39 +1300)]
Merge pull request #18914 from totten/master-auth-client
dev/core#2141 - Add "oauth-client" extension (hidden)
Eileen McNaughton [Tue, 3 Nov 2020 19:34:49 +0000 (08:34 +1300)]
Merge pull request #18864 from demeritcowboy/logz
dev/core#2148 - Incorrect use of ts, quotes, escape in log call
colemanw [Tue, 3 Nov 2020 17:10:49 +0000 (12:10 -0500)]
Merge pull request #18915 from colemanw/entityPaths2
Use standard names for entity paths and add a few more paths
colemanw [Tue, 3 Nov 2020 16:44:34 +0000 (11:44 -0500)]
Merge pull request #18910 from totten/master-error-log
CRM_Core_Error::formatFooException - Don't bomb on 'Error'
Coleman Watts [Tue, 3 Nov 2020 14:32:38 +0000 (09:32 -0500)]
Use standard names from CRM_Core_Action for entity paths and add a few more paths
For the sake of consistency, this changes the newly-added entity paths to follow the naming convention in CRM_Core_Action:
add/update/view/delete
instead of create/edit/view/delete
colemanw [Tue, 3 Nov 2020 14:07:00 +0000 (09:07 -0500)]
Merge pull request #18909 from colemanw/searchDisplay2
Search ext: Add links to search admin and improve links in displays
Tim Otten [Tue, 3 Nov 2020 12:25:43 +0000 (04:25 -0800)]
oauth-client - Add basic UI to inspect/debug JWT-based tokens
Tim Otten [Tue, 3 Nov 2020 03:36:14 +0000 (19:36 -0800)]
dev/core#2141 - AuthorizationCode - Validate that the final return URL is internal
Tim Otten [Tue, 3 Nov 2020 01:08:20 +0000 (17:08 -0800)]
oauth-client - Add menu item ("Admin: System Settings: OAuth")
Tim Otten [Mon, 2 Nov 2020 06:17:06 +0000 (22:17 -0800)]
dev/core#2141 - Basic UI for CRUD'ing clients
Tim Otten [Mon, 2 Nov 2020 22:44:49 +0000 (14:44 -0800)]
oauth-client - Mark extension as hidden
Tim Otten [Mon, 2 Nov 2020 09:41:13 +0000 (01:41 -0800)]
dev/core#2141 - Set prompt=select_account whenever using MailSetup
If you're an admin setting up an email return-channel, then you may not
intend to use your normal email account. It makes sense to always prompt
for the preferred account.
Tim Otten [Sat, 31 Oct 2020 01:39:21 +0000 (18:39 -0700)]
dev/core#2141 - If a mail-store has an OAuth2 token, then use it
Tim Otten [Fri, 30 Oct 2020 08:39:58 +0000 (01:39 -0700)]
dev/core#2141 - Allow OAuth2 services to define mail setup routine
Overview
--------
For certain types of mail accounts -- such as Google Mail and Microsoft
Exchange Online -- the setup process may require interaction with a remote
web-service.
If you have OAuth2 enabled for one of these services, then this will create
an option for "Add Mail Account".
Before
------
There is no setup procedure.
After
-----
* Navigate to "Administer => CiviMail => Mail Accounts".
* Below the table, there is a select2 box for "Add Mail Account".
* If "Microsoft Exchange Online" is configured, then it will appear in the dropdown. Choose it.
* It redirects to MS to get authorization from the user (OAuth2 Authorization Code).
* The user comes back.
* We initialize a new mail account (`MailSettings` / `civicrm_mail_settings`)
* We accept the code and save the token (`OAuthSysToken`) with the account.
* We redirect to the account configuration form.
Technical Details
-----------------
The new mail account will have some details, such as `server`, `protocol`,
and `username` pre-filled. This uses a template -- see e.g.
`providers/ms-exchange.dist.json` (`mailSettingsTemplate`).
Tim Otten [Fri, 30 Oct 2020 07:13:35 +0000 (00:13 -0700)]
dev/core#2141 - AuthorizationGrant - Upon return, emit hook & possible redirect
Tim Otten [Fri, 30 Oct 2020 00:58:01 +0000 (17:58 -0700)]
dev/core#2141 - Add support for token-tagging to all grant flows
Suppose you have a downstream app/module -- such as the Civi-IMAP app/module. It needs to store a notation which says
"this thing in our data" (e.g. `civicrm_mail_settings`) "corresponds to that token in the OAuth data".
It can put a tag on the token (`tag=civicrm_mail_settings:123`) and use that for lookup
```
$tag = `OAuthSysToken.refresh +w tag=civicrm_mail_settings:123`
```
The advantage of this is that it's simple, flexible, and doesn't require new schema.
Of course, it's not end-all/be-all. It's OK for 1:1 relationship. But if
you want 1:M or M:M, then you'll have to model that as something else. But
for basic usage, tags are simple and moderately flexible.
Tim Otten [Thu, 29 Oct 2020 01:47:42 +0000 (18:47 -0700)]
dev/core#2141 - Add "local-redir" stub for use as OAuth2 "Redirect URL"
If you are developing on a local HTTP system with virtual hosts, then many
OAuth2 services won't recognize it as a local/dev URL.
The "local-redir.sh" script runs a stub service that will be accepted as
a local/dev "Redirect URL".
Tim Otten [Wed, 28 Oct 2020 22:32:05 +0000 (15:32 -0700)]
dev/core#2141 - APIv4 - Add `OAuthClient.clientCredential` authentication
Tim Otten [Wed, 28 Oct 2020 21:05:03 +0000 (14:05 -0700)]
dev/core#2141 - APIv4 - Add `OAuthClient.userPassword` authentication
Tim Otten [Wed, 28 Oct 2020 08:39:15 +0000 (01:39 -0700)]
dev/core#2141 - APIv4 - Add OAuthSysToken.refresh action
Tim Otten [Wed, 28 Oct 2020 09:28:24 +0000 (02:28 -0700)]
dev/core#2141 - APIv4 - Add `OAuthClient.authorizationCode` authentication
Tim Otten [Thu, 29 Oct 2020 00:08:29 +0000 (17:08 -0700)]
dev/core#2141 - Update 'oauth2.league' to respect setting 'oauthClientRedirectUrl'
Tim Otten [Tue, 27 Oct 2020 13:15:43 +0000 (06:15 -0700)]
dev/core#2141 - Add services 'oauth2.league' and 'oauth2.token'
Tim Otten [Tue, 27 Oct 2020 12:20:38 +0000 (05:20 -0700)]
dev/core#2141 - APIv4 - Expands tests for OAuthSysToken
Tim Otten [Tue, 27 Oct 2020 11:16:10 +0000 (04:16 -0700)]
dev/core#2141 - APIv4 - Validate OAuthClient.provider property
Tim Otten [Tue, 27 Oct 2020 00:34:12 +0000 (17:34 -0700)]
dev/core#2141 - APIv4 - Add OAuthClient & OAuthSysToken with unit-test
Tim Otten [Fri, 23 Oct 2020 05:46:03 +0000 (22:46 -0700)]
dev/core#2141 - Schema - Add OAuthClient and OAuthSysToken
Depends on OAuthProvider and permissions ('manage OAuth client' and 'manage OAuth client secrets')
Tim Otten [Fri, 30 Oct 2020 09:04:37 +0000 (02:04 -0700)]
dev/core#2141 - Split OAuthProvider files into subdirs. Use long cache.
Tim Otten [Tue, 27 Oct 2020 10:02:28 +0000 (03:02 -0700)]
dev/core#2141 - APIv4 - Add OAuthProvider.get w/test. Split dist/local/test lists.
Tim Otten [Mon, 26 Oct 2020 23:28:36 +0000 (16:28 -0700)]
dev/core#2141 - Permissions - Define 'manage OAuth client' and 'manage OAuth client secrets'
Tim Otten [Fri, 30 Oct 2020 00:41:48 +0000 (17:41 -0700)]
dev/core#2141 - Add upgrader to skeletal ext/oauth-client
Tim Otten [Sat, 24 Oct 2020 00:15:25 +0000 (17:15 -0700)]
dev/core#2141 - Generate skeletal ext/oauth-client
Tim Otten [Tue, 3 Nov 2020 06:02:02 +0000 (22:02 -0800)]
MailSettings - Add button+API for testing a connection
Tim Otten [Tue, 3 Nov 2020 06:01:22 +0000 (22:01 -0800)]
(NFC) CRM_Mailing_MailStore - Clarify return type
Tim Otten [Tue, 3 Nov 2020 05:54:45 +0000 (21:54 -0800)]
CRM_Core_Error::formatFooException - Don't bomb on 'Error'
PHP 7 updated the class hierarchy for exceptions. The top-level types for exceptions are now:
* class Throwable
* class Error extends Throwable
* class Exception extends Throwable
This patch fixes a problem when logging `Error`s, as in
```php
Civi::log()->warning('There was a problem', [
'exception' => $e
]);
```
Before
------
If `$e` is an `Error`, it fails to log.
After
-----
It works whether `$e` is an `Error` or `Exception`.
See also: https://www.php.net/manual/en/language.errors.php7.php
Coleman Watts [Tue, 3 Nov 2020 02:16:17 +0000 (21:16 -0500)]
Search ext: Add links to search admin and improve links in displays
Seamus Lee [Tue, 3 Nov 2020 01:09:06 +0000 (12:09 +1100)]
Merge pull request #18908 from totten/master-composer-oauth
dev/core#2141 - composer.json - Require league/oauth2-{client,google}
demeritcowboy [Tue, 27 Oct 2020 19:11:02 +0000 (15:11 -0400)]
a couple problems
Tim Otten [Wed, 21 Oct 2020 22:15:43 +0000 (15:15 -0700)]
composer.lock - Require league/oauth2-{client,google}
Tim Otten [Wed, 21 Oct 2020 22:13:31 +0000 (15:13 -0700)]
composer.json - Require league/oauth2-{client,google}
Note: This oauth2-client matches the constraint that's declared in civixero, which (in my
local copy of `universe`) is the only published extension that uses the same library.
The oauth2-google is included because has special requirements around
'prompt' which conflict with `GenericProvider`. We could potentially resolve that other
ways (eg rework `CiviGenericProvider`), but this seems easier right now.
Seamus Lee [Mon, 2 Nov 2020 20:03:49 +0000 (07:03 +1100)]
Merge pull request #18904 from civicrm/5.31
5.31
Alice Frumin [Mon, 2 Nov 2020 18:56:51 +0000 (12:56 -0600)]
dev/core#2139 fix defaulting for multi-select custom fields
Matthew Wire [Mon, 2 Nov 2020 11:02:46 +0000 (11:02 +0000)]
Merge pull request #18802 from eileenmcnaughton/refs
dev/core#2043 Remove instance of pass-by-ref
Matthew Wire [Mon, 2 Nov 2020 11:01:55 +0000 (11:01 +0000)]
Merge pull request #18894 from eileenmcnaughton/cancel
Move call to update related pledges on contribution cancel to extension
Matthew Wire [Mon, 2 Nov 2020 11:00:40 +0000 (11:00 +0000)]
Merge pull request #18895 from eileenmcnaughton/ipn
Remove IPN reference to _relatedObjects, deprecate property
Matthew Wire [Mon, 2 Nov 2020 11:00:07 +0000 (11:00 +0000)]
Merge pull request #18896 from eileenmcnaughton/ipn2
[Ref] Simplify params
Matthew Wire [Mon, 2 Nov 2020 10:59:39 +0000 (10:59 +0000)]
Merge pull request #18900 from eileenmcnaughton/entry
[REF] Simplify use of shared code.
Matthew Wire [Mon, 2 Nov 2020 10:58:10 +0000 (10:58 +0000)]
Merge pull request #18903 from eileenmcnaughton/aip2
Remove deprecated code
Matthew Wire [Mon, 2 Nov 2020 10:55:38 +0000 (10:55 +0000)]
Merge pull request #18807 from jvos/postProcess-MessageTemplates
Add postProcess hook to MessageTemplates
Seamus Lee [Mon, 2 Nov 2020 08:41:37 +0000 (19:41 +1100)]
Merge pull request #18899 from seamuslee001/composer_2x
Update composer-download-plugin to v3.0.0 to support usage of compose…
Seamus Lee [Mon, 2 Nov 2020 07:20:35 +0000 (18:20 +1100)]
Merge pull request #18901 from alifrumin/5.31rn
[NFC] 5.31 Release Notes - First Pass
Seamus Lee [Mon, 2 Nov 2020 06:50:56 +0000 (17:50 +1100)]
Merge pull request #18897 from eileenmcnaughton/ip3
[REF] Remove silly if
Seamus Lee [Mon, 2 Nov 2020 06:50:10 +0000 (17:50 +1100)]
Merge pull request #18902 from totten/master-altermailstore
dev/core#2141 - Add hook_civicrm_alterMailStore
Seamus Lee [Mon, 2 Nov 2020 05:40:22 +0000 (16:40 +1100)]
Merge pull request #18898 from seamuslee001/dev_core_2147
dev/core#2147 Switch the groups search field on Simple search back fr…
Seamus Lee [Mon, 2 Nov 2020 02:07:15 +0000 (13:07 +1100)]
Update composer-download-plugin to v3.0.0 to support usage of composer 2.x
eileen [Mon, 2 Nov 2020 04:18:54 +0000 (17:18 +1300)]
Remove deprecated code
These few lines have had any meaning removed already....
Seamus Lee [Mon, 2 Nov 2020 04:08:25 +0000 (15:08 +1100)]
Merge pull request #18852 from eileenmcnaughton/aip
[Ref] Move sending the email back out of the recur function
Tim Otten [Fri, 30 Oct 2020 23:01:42 +0000 (16:01 -0700)]
dev/core#2141 - Add hook_civicrm_alterMailStore
Overview
--------
The CiviCRM "MailStore" layer is used for importing email messages from
various sources (IMAP, POP3, Maildir, etc). There is a built-in list with a
handful of drivers (`CRM_Mailing_MailStore_Imap`, etc).
This patch adds a hook for manipulating those drivers.
Before
------
It's not possible for an extension to add a driver, modify a driver, etc.
After
-----
It is now possible to add/modify/replace drivers. Here are two examples.
(1) To supplement the IMAP authentication with a dynamic token for XOAuth2:
```php
function hook_civicrm_alterMailStore(&$mailSettings) {
if (...$mailSettings requires oauth...) {
$mailSettings['auth'] = 'XOAuth2';
$mailSettings['password'] = $myOauthSystem->getToken(...);
}
}
```
(2) To add a new protocol `FIZZBUZZ`, you would:
1. Register a value in the OptionGroup `mail_protocol`.
2. Create a driver class (eg `CRM_Mailing_MailStore_FizzBuzz` extends `CRM_Mailing_MailStore`)
3. Use the hook to activate the class:
```php
function hook_civicrm_alterMailStore(&$mailSettings) {
if ($mailSettings['protocol'] === 'FIZZBUZZ') {
$mailSettings['factory'] = function ($mailSettings) {
return new CRM_Mailing_MailStore_FizzBuzz(...);
};
}
}
```
Technical Details
-----------------
This adds a unit-test with examples of basic/non-hook behavior and hooked behavior.
In reading the diff for `getStore()`, note that it previously had a long
'switch()' to handle instantiation. I tried to make the change in a way that
you could see some continuity - e.g. it's still the same basic `switch()`.
The change is to basically wrap the bits inside a function:
* Before: `case 'FOO': return new Foo(...)`
* After: `case 'FOO': return ['factory' => function(...) { return new Foo(...); }]`
Alice Frumin [Fri, 23 Oct 2020 01:04:04 +0000 (20:04 -0500)]
5.31 release notes first pass
eileen [Mon, 2 Nov 2020 02:24:27 +0000 (15:24 +1300)]
[REF] Simplify use of shared code.
This function has been sharing 'transitionComponentWithStatusMessage' but in
fact it throws away the status message and the preliminary checks are silly.
This simplifies it so it calls the part of the function it actually does share
eileen [Sun, 1 Nov 2020 23:16:31 +0000 (12:16 +1300)]
Move call to update related pledges on contribution cancel to extension
This moves the functionality over & switches Order api to be entirely relying on the
hook rather than a call to the deprecated transitionComponents function.
eileen [Mon, 2 Nov 2020 00:03:28 +0000 (13:03 +1300)]
[REF] Remove silly if
Checking component AND contributionRecur is silly - the latter will only
be set if relevant so remove the extra if
Seamus Lee [Mon, 2 Nov 2020 01:31:09 +0000 (12:31 +1100)]
dev/core#2147 Switch the groups search field on Simple search back from select2 to normal select
eileen [Sun, 1 Nov 2020 23:45:36 +0000 (12:45 +1300)]
[Ref] Simplify params
As with
https://github.com/civicrm/civicrm-core/commit/
0d74d91cd340b9f1ea2224119c748e372dffe245
pass the retrieved parameters to the single function rather than the id of the
object retrieved based on them
eileen [Sun, 1 Nov 2020 23:36:10 +0000 (12:36 +1300)]
Remove IPN reference to _relatedObjects, deprecate property
Eileen McNaughton [Sun, 1 Nov 2020 20:51:57 +0000 (09:51 +1300)]
Merge pull request #18893 from civicrm/5.31
5.31 to master
Eileen McNaughton [Sun, 1 Nov 2020 20:51:02 +0000 (09:51 +1300)]
Merge pull request #18877 from seamuslee001/dev_core_2149
dev/core#2149 Ensure that if a chained select field is required and t…
Matthew Wire [Sun, 1 Nov 2020 18:25:18 +0000 (18:25 +0000)]
Merge pull request #18881 from eileenmcnaughton/cancelb
dev/core#927 Move handling of participant.cancel from BaseIPN to contributioncancelactions
Matthew Wire [Sun, 1 Nov 2020 18:22:12 +0000 (18:22 +0000)]
Merge pull request #18882 from eileenmcnaughton/pps
[Ref] Use direct version of participant id
colemanw [Sat, 31 Oct 2020 13:44:15 +0000 (09:44 -0400)]
Merge pull request #18892 from eileenmcnaughton/uf
Hack away at false negative test fails
Seamus Lee [Sat, 31 Oct 2020 03:02:07 +0000 (14:02 +1100)]
Merge pull request #18891 from civicrm/5.31
5.31
Seamus Lee [Sat, 31 Oct 2020 00:53:04 +0000 (11:53 +1100)]
Merge pull request #18890 from seamuslee001/dev_core_2154
dev/core#2154 Fix the output of the full text custom search form
Eileen McNaughton [Fri, 30 Oct 2020 23:48:37 +0000 (12:48 +1300)]
Merge pull request #18887 from colemanw/entityPaths
Add entity paths to schema & APIv4
eileen [Fri, 30 Oct 2020 23:23:00 +0000 (12:23 +1300)]
Hack away at false negative test fails
colemanw [Fri, 30 Oct 2020 23:10:09 +0000 (19:10 -0400)]
Merge pull request #18889 from demeritcowboy/fulltext-attributes
dev/core#2154 - Pass correct parameters to CRM_Core_Form::add() in fulltext custom search