civicrm-core.git
3 years agoFix Contribution.create to not attempt to set contacts on activity update
eileen [Mon, 14 Dec 2020 01:26:16 +0000 (14:26 +1300)]
Fix Contribution.create to not attempt to set contacts on activity update

In udpate cases the original allocations were more correct

3 years agoMerge pull request #19201 from eileenmcnaughton/notice
Seamus Lee [Mon, 14 Dec 2020 03:37:53 +0000 (14:37 +1100)]
Merge pull request #19201 from eileenmcnaughton/notice

Enotice fix

3 years agoEnotice fix
eileen [Mon, 14 Dec 2020 01:27:34 +0000 (14:27 +1300)]
Enotice fix

3 years agoMerge pull request #19196 from seamuslee001/apiv4_blob_fields
colemanw [Sun, 13 Dec 2020 23:11:58 +0000 (18:11 -0500)]
Merge pull request #19196 from seamuslee001/apiv4_blob_fields

REF Allow for fields of type Blob or Mediumblob in Apiv4

3 years agoMerge pull request #19198 from seamuslee001/xdebug_singlevalue
Eileen McNaughton [Sun, 13 Dec 2020 19:53:48 +0000 (08:53 +1300)]
Merge pull request #19198 from seamuslee001/xdebug_singlevalue

NFC When printing out the result of the correctly update in single va…

3 years agoNFC When printing out the result of the correctly update in single value alter ensure...
Seamus Lee [Sun, 13 Dec 2020 06:13:31 +0000 (17:13 +1100)]
NFC When printing out the result of the correctly update in single value alter ensure that xdebug isn't printed

3 years agoMerge pull request #19190 from eileenmcnaughton/import22
Seamus Lee [Sun, 13 Dec 2020 03:14:11 +0000 (14:14 +1100)]
Merge pull request #19190 from eileenmcnaughton/import22

Squash 2 if clauses into 1

3 years agoMerge pull request #19197 from demeritcowboy/key-comments
Seamus Lee [Sun, 13 Dec 2020 02:47:51 +0000 (13:47 +1100)]
Merge pull request #19197 from demeritcowboy/key-comments

[NFC] Update comments in CRM/Core/Key

4 years agoupdate comments
demeritcowboy [Sat, 12 Dec 2020 22:56:01 +0000 (17:56 -0500)]
update comments

4 years agoREF Allow for fields of type Blob or Mediumblob in Apiv4
Seamus Lee [Sat, 12 Dec 2020 21:33:01 +0000 (08:33 +1100)]
REF Allow for fields of type Blob or Mediumblob in Apiv4

4 years agoMerge pull request #19187 from civicrm/5.33
Seamus Lee [Sat, 12 Dec 2020 20:02:52 +0000 (07:02 +1100)]
Merge pull request #19187 from civicrm/5.33

5.33

4 years agoMerge pull request #19145 from totten/master-qfkey
Seamus Lee [Sat, 12 Dec 2020 20:01:58 +0000 (07:01 +1100)]
Merge pull request #19145 from totten/master-qfkey

CRM_Core_Key - Provide more debugging hints about mismatched`qfKey`s

4 years agoMerge pull request #19193 from eileenmcnaughton/ref
Seamus Lee [Sat, 12 Dec 2020 09:49:31 +0000 (20:49 +1100)]
Merge pull request #19193 from eileenmcnaughton/ref

[REF] Extract determination of subscription status information

4 years agoMerge pull request #19192 from totten/5.33-upgrade
Seamus Lee [Sat, 12 Dec 2020 09:45:52 +0000 (20:45 +1100)]
Merge pull request #19192 from totten/5.33-upgrade

dev/core#2232 - Upgrade UI contaminates cache via l10n-js. Consolidate isUpgradeMode().

4 years agoMerge pull request #19160 from eileenmcnaughton/import
Seamus Lee [Sat, 12 Dec 2020 08:40:21 +0000 (19:40 +1100)]
Merge pull request #19160 from eileenmcnaughton/import

Clean up error handling in legacy functions in import parser

4 years agoMerge pull request #19191 from eileenmcnaughton/deprecated
Seamus Lee [Sat, 12 Dec 2020 08:39:58 +0000 (19:39 +1100)]
Merge pull request #19191 from eileenmcnaughton/deprecated

Remove some deprecated code chunks

4 years agoMerge pull request #19195 from seamuslee001/5322_rn
Seamus Lee [Sat, 12 Dec 2020 08:08:28 +0000 (19:08 +1100)]
Merge pull request #19195 from seamuslee001/5322_rn

Add release-notes/5.32.2.md

4 years agoAdd release-notes/5.32.2.md
Tim Otten [Sat, 12 Dec 2020 06:24:03 +0000 (22:24 -0800)]
Add release-notes/5.32.2.md

4 years ago[REF] Extract determination of subscription status information
eileen [Sat, 12 Dec 2020 06:01:42 +0000 (19:01 +1300)]
[REF] Extract determination of subscription status information

This gets us away from it being buried in a switch

4 years agoRemove some deprecated code chunks
eileen [Sat, 12 Dec 2020 05:37:25 +0000 (18:37 +1300)]
Remove some deprecated code chunks

4 years agoClean up error handling in legacy functions in import parser
eileen [Thu, 10 Dec 2020 19:42:27 +0000 (08:42 +1300)]
Clean up error handling in legacy functions in import parser

This makes the handling of errors cleaner & makes it easier for us to unravel what is going on here.

4 years agoMerge pull request #19189 from eileenmcnaughton/533q1
Seamus Lee [Sat, 12 Dec 2020 05:27:49 +0000 (16:27 +1100)]
Merge pull request #19189 from eileenmcnaughton/533q1

Fix failure to assign view tpl variables to view page if context=search is in the url

4 years agoPartial revert "dev/core#2232 Permit hook_civicrm_container and some other prebootish...
Tim Otten [Sat, 12 Dec 2020 05:08:20 +0000 (21:08 -0800)]
Partial revert "dev/core#2232 Permit hook_civicrm_container and some other prebootish hooks to run during upgrade and clear out the asset builder cache post upgrade"

This reverts commit 756d9e0dbbe4ff66d2568f02a8ee1f152bd9c5e5.

4 years agodev/core#2232 - Upgrade UI contaminates cache via l10n-js. Consolidate isUpgradeMode().
Tim Otten [Sat, 12 Dec 2020 03:33:23 +0000 (19:33 -0800)]
dev/core#2232 - Upgrade UI contaminates cache via l10n-js. Consolidate isUpgradeMode().

This patch fixes an upgrade bug where `CachedCiviContainer` has stale data after an upgrade.

To do this, it removes an edge-case where two overlapping functions disagree.

Steps to Reproduce
------------------

1. Create a new/empty WP build
2. Install CiviCRM 5.30.1 from zipball
3. Install Mosaico 2.5
4. Download+extract new 5.32.1 zipball
5. Navigate to the GUI upgrade screen. Execute upgrade
6. Click to go back to the CiviCRM dashboard.
7. Receive error about the service 'mosaico_graphics'

Discussion
----------

The problem is created while running the upgrade GUI (step 5).  The GUI sends several HTTP
requests (`civicrm/upgrade`, `civicrm/upgrade/queue/ajax/runNext`, etc).  At the end, there is
an HTTP request for `civicrm/ajax/l10n-js/en_US`.  The `l10n-js` request creates a flawed copy
of `CachedCiviContainer` which is responsible for subsequent errors.

This shouldn't happen - there are defensive mechanism which prevent it from happening (e.g.
during `civicrm/upgrade`).  What makes `civicrm/ajax/l10n-js/en_US` different?  It turns on
the implementation of `isUpgradeMode()` which activates the defensive mechanisms.

Before
------

There are two implementations of `isUpgradeMode()` (via `CRM_Core_Config` and
`CRM_Utils_System`).  They often agree, but not always.

Some defensive measures trigger on `CRM_Core_Config::isUpgradeMode()` and others trigger on
`CRM_Utils_System::isUpgradeMode()`.  They often trigger together, but not always.

Let's see how these can playout in a few HTTP requests:

1. `civicrm/dashboard`: The functions agree -- it's a regular page, not an upgrade.  Therefore:
     * (a) It allows extensions to run fully.
     * (b) It enables `CachedCiviContainer` (read or write automatically).
     * (a+b) It puts good/full information in the cache.
2. `civicrm/upgrade`: The functions agree -- it's an upgrade. Therefore:
     * (a) It runs in paranoid mode (suspended extensions).
     * (b) It disables `CachedCiviContainer`.
     * (a+b) It puts no information in the cache.
3. `civicrm/ajax/l10n-js/en_US`: The functions *disagree*. In this case:
     * (a) It runs in paranoid mode (suspended extensions).
     * (b) It enables `CachedCiviContainer` (read or write automatically).
     * (a+b) It puts bad/incomplete information in the cache.

After
-----

There is one implementation of `isUpgradeMode()`.  It may be called through
either class (`CRM_Core_Config` or `CRM_Utils_System`), but the results will
always agree.

This produces the same appropriate outcome for cases of agreement (1) (2), and it fixes the
wonky/mismatched behavior in (3).

4 years agoSquash 2 if clauses into 1
eileen [Sat, 12 Dec 2020 03:34:28 +0000 (16:34 +1300)]
Squash 2 if clauses into 1

The action is the same for both criteria so in_array rather than 2 * if =
makes it more readable

4 years agoMerge pull request #19185 from eileenmcnaughton/533q
Seamus Lee [Sat, 12 Dec 2020 02:41:20 +0000 (13:41 +1100)]
Merge pull request #19185 from eileenmcnaughton/533q

dev/core#1019 Fix currency formatting of Total Amount on Event and Contribution pages (with multi-currency form support)

4 years agoFix failure to assign view tpl variables to view page if context=search is in the url
eileen [Sat, 12 Dec 2020 02:37:43 +0000 (15:37 +1300)]
Fix failure to assign view tpl variables to view page if context=search is in the url

Whack-a-mole round 10

4 years agoMerge pull request #19183 from eileenmcnaughton/533e
Seamus Lee [Sat, 12 Dec 2020 01:49:42 +0000 (12:49 +1100)]
Merge pull request #19183 from eileenmcnaughton/533e

dev/core#2248 Ensure variables are assigned to tpl for urls

4 years agodev/core#1019 Fix currency formatting of Total Amount on Event and Contribution pages...
Mathieu Lutfy [Wed, 9 Dec 2020 14:28:25 +0000 (09:28 -0500)]
dev/core#1019 Fix currency formatting of Total Amount on Event and Contribution pages (with multi-currency form support)

4 years agodev/core#2248 Ensure variables are assigned to tpl for urls
eileen [Fri, 11 Dec 2020 23:44:06 +0000 (12:44 +1300)]
dev/core#2248 Ensure variables are assigned to tpl for urls

4 years agoMerge pull request #19182 from eileenmcnaughton/else
Seamus Lee [Fri, 11 Dec 2020 23:34:48 +0000 (10:34 +1100)]
Merge pull request #19182 from eileenmcnaughton/else

Remove extraneous elses

4 years agoMerge pull request #19085 from eileenmcnaughton/words
Seamus Lee [Fri, 11 Dec 2020 23:34:05 +0000 (10:34 +1100)]
Merge pull request #19085 from eileenmcnaughton/words

dev/financial#158  change UI parts of contribution soft schema to soft credit

4 years agoCRM_Core_Key - Add some basic unit tests
Tim Otten [Fri, 11 Dec 2020 22:08:46 +0000 (14:08 -0800)]
CRM_Core_Key - Add some basic unit tests

4 years agoCRM_Core_Key - Provide more debugging hints about `qfKey`s
Tim Otten [Tue, 8 Dec 2020 23:15:45 +0000 (15:15 -0800)]
CRM_Core_Key - Provide more debugging hints about `qfKey`s

Overview
--------

The `qfKey` parameter is a security mechanism (CSRF). The content of `qfKey` is also inscrutable - so when there's a problem
with `qfKey`, it can be difficult to determine the origin/nature of the problem.

Before
------

The `qfKey` provides a digital signature based on (1) session ID, (2) the
form being processed, (3) a random private-key (unique to the user/session).
In some cases, the `qfKey` also has a random nonce appended to distinguish
between concurrent tabs that work with the same form.

* Ex: `2abc4b7f23d9ae4dfcdbb0c692cc666e5f11256fe84ace7662b0e075834b81958` (w/o nonce)
* Ex: `2abc4b7f23d9ae4dfcdbb0c692cc666e5f11256fe84ace7662b0e075834b81958_9527` (w/nonce)

If there is a logic problem where the `qfKey` of form A gets mixed-up with
form B, then it's extremely hard to understand the mismatch All you see are
two long random codes.

* Inputted qfKey: `2abc4b7f23d9ae4dfcdbb0c692cc666e5f11256fe84ace7662b0e075834b81958`
* Expected fqKey: `89874b7a23192e4d6aab10c622ca369e5e11226f784a5c7652b95075536b81a5e`

After
-----

The `qfKey` has a prefix to indicate the token's intended usage (as well as a digital signature).

* Ex: `CRMContactControllerSearch154eitbf74v3ko0sw94k08gogo8448asdfw4goggkkwgkww08c` (w/o nonce)
* Ex: `CRMContactControllerSearch154eitbf74v3ko0sw94k08gogo8448asdfw4goggkkwgkww08c_9355` (w/ nonce)

If there is a logic problem where the `qfKey` of form A gets mixed-up with
form B, then the prefix can help you understand. Compare:

* Inputted qfKey: `CRMContactControllerSearch154eitbf74v3ko0sw94k08gogo8448asdfw4goggkkwgkww08c`
* Expected qfKey: `CRMContributeFormContribution5o2due205mp0384080sgc8omw8kwggoksw47sswchs80gw0kgs`

This tells you that there's logical mismatch - it's trying to render the contribution
screen using the key for the contact-search screen.

Comments
--------

* The identity of the `formname` is not sensitive information.
* The `qfKey` might look prettier with more delimeters (`{formname}_{signature}_{nonce}`). However, I belive there are random bits of existing code
  which use `explode('_')` to split apart the signature and the nonce. This formula seems to be drop-in/interoperable.
* I switched the encoding of the signature from hex (0-9a-f) to base-36 (0-9a-z) to make it a bit shorter.

4 years agoRemove extraneous elses
eileen [Fri, 11 Dec 2020 20:26:45 +0000 (09:26 +1300)]
Remove extraneous elses

4 years agodev/financial#158 change UI parts of contribution soft schema to soft credit
eileen [Tue, 1 Dec 2020 03:51:48 +0000 (16:51 +1300)]
dev/financial#158  change UI parts of contribution soft schema to soft credit

4 years agoMerge pull request #19180 from civicrm/5.33
Seamus Lee [Fri, 11 Dec 2020 09:05:56 +0000 (20:05 +1100)]
Merge pull request #19180 from civicrm/5.33

5.33

4 years agoMerge pull request #19179 from demeritcowboy/depwarn
Seamus Lee [Fri, 11 Dec 2020 09:05:39 +0000 (20:05 +1100)]
Merge pull request #19179 from demeritcowboy/depwarn

[NFC] Convert civi.tag-deprecated to use central function

4 years agoMerge pull request #19176 from eileenmcnaughton/533m
Seamus Lee [Fri, 11 Dec 2020 07:40:41 +0000 (18:40 +1100)]
Merge pull request #19176 from eileenmcnaughton/533m

dev/core#2246 Fix failure to filter exports

4 years agoMerge pull request #19172 from eileenmcnaughton/dep_match
Seamus Lee [Fri, 11 Dec 2020 07:35:53 +0000 (18:35 +1100)]
Merge pull request #19172 from eileenmcnaughton/dep_match

[REF] extract getIdsOfMatchingContact

4 years agoMerge pull request #19167 from demeritcowboy/legacy-warnings
Seamus Lee [Fri, 11 Dec 2020 07:24:07 +0000 (18:24 +1100)]
Merge pull request #19167 from demeritcowboy/legacy-warnings

Unused writeLegacyWarnings() in PropertyBag

4 years agoconvert to central function
demeritcowboy [Fri, 11 Dec 2020 06:30:33 +0000 (01:30 -0500)]
convert to central function

4 years ago[REF] extract getIdsOfMatchingContact
eileen [Fri, 11 Dec 2020 01:58:41 +0000 (14:58 +1300)]
[REF] extract getIdsOfMatchingContact

It seems this really needs sorting to be shared between the parser classes
to fix up the error handling

4 years agoMerge pull request #19171 from eileenmcnaughton/else
Eileen McNaughton [Fri, 11 Dec 2020 05:14:01 +0000 (18:14 +1300)]
Merge pull request #19171 from eileenmcnaughton/else

Remove extraneous elses

4 years agoMerge pull request #19178 from civicrm/5.33
Eileen McNaughton [Fri, 11 Dec 2020 05:13:41 +0000 (18:13 +1300)]
Merge pull request #19178 from civicrm/5.33

5.33 to master

4 years agoMerge pull request #19173 from eileenmcnaughton/533
Eileen McNaughton [Fri, 11 Dec 2020 05:13:06 +0000 (18:13 +1300)]
Merge pull request #19173 from eileenmcnaughton/533

dev/core#2244 Simplify and consistently apply checking of whether financial acls are enabled

4 years agodev/core#2246 Fix failure to filter exports
eileen [Fri, 11 Dec 2020 05:04:25 +0000 (18:04 +1300)]
dev/core#2246 Fix failure to filter exports

This fixes regression caused by us more consistently setting componentTable.

The short version here is that the presence of a componentClause should take precedences
over the inner join intended as a blunt, and maybe unnecessary, measure to
limit the export to the entity in question

4 years agoMerge pull request #19164 from eileenmcnaughton/member
Seamus Lee [Fri, 11 Dec 2020 03:32:15 +0000 (14:32 +1100)]
Merge pull request #19164 from eileenmcnaughton/member

Switch to non-static functions

4 years agodev/core#2244 Simplify and consistently apply checking of whether financial acls...
eileen [Fri, 11 Dec 2020 02:26:21 +0000 (15:26 +1300)]
dev/core#2244 Simplify and consistently apply checking of whether financial acls are enabled

Per https://lab.civicrm.org/dev/core/-/issues/2244 the move of some handling to this function
did not consistently include an early return when the setting is toggled off.

Eventually there will be no setting - just 'is this extension enabled or not' but
in the transition we need this. The new version is easier to copy and paste :-)
and uses a function in the extension. The function in the main code base is
mostly a lot of code to handle the way the setting used to be stored & it
could just check the setting too now

4 years agoMerge pull request #19166 from eileenmcnaughton/cont_type
Seamus Lee [Fri, 11 Dec 2020 02:10:35 +0000 (13:10 +1100)]
Merge pull request #19166 from eileenmcnaughton/cont_type

dev/financial#163 Rename / remove internal references to contributionTypeID

4 years agoMerge pull request #19169 from eileenmcnaughton/cont_type2
Seamus Lee [Fri, 11 Dec 2020 02:10:05 +0000 (13:10 +1100)]
Merge pull request #19169 from eileenmcnaughton/cont_type2

Rename internal references to contributionTypeId

4 years agoRemove extraneous elses
eileen [Fri, 11 Dec 2020 01:39:05 +0000 (14:39 +1300)]
Remove extraneous elses

Further removal of elses directly after a return

4 years agoMerge pull request #19168 from eileenmcnaughton/dup_error
Seamus Lee [Fri, 11 Dec 2020 00:55:08 +0000 (11:55 +1100)]
Merge pull request #19168 from eileenmcnaughton/dup_error

Remove extraneous elses

4 years agoMerge pull request #19017 from eileenmcnaughton/remove_recur
Matthew Wire [Thu, 10 Dec 2020 23:46:06 +0000 (23:46 +0000)]
Merge pull request #19017 from eileenmcnaughton/remove_recur

dev/financial#152 remove determination of source

4 years agono longer used
demeritcowboy [Thu, 10 Dec 2020 21:53:31 +0000 (16:53 -0500)]
no longer used

4 years agoMerge pull request #18854 from eileenmcnaughton/memlabel
Eileen McNaughton [Thu, 10 Dec 2020 22:58:48 +0000 (11:58 +1300)]
Merge pull request #18854 from eileenmcnaughton/memlabel

[REF] Extract function to retrieve the membership labels.

4 years agoMerge pull request #19162 from civicrm/5.33
Seamus Lee [Thu, 10 Dec 2020 22:53:20 +0000 (09:53 +1100)]
Merge pull request #19162 from civicrm/5.33

5.33

4 years agoMerge pull request #18905 from eileenmcnaughton/mail
Seamus Lee [Thu, 10 Dec 2020 22:50:53 +0000 (09:50 +1100)]
Merge pull request #18905 from eileenmcnaughton/mail

dev/core#2159 Handle exceptions in Mail:send class

4 years agoRename internal references to contributionTypeId
eileen [Thu, 10 Dec 2020 21:31:27 +0000 (10:31 +1300)]
Rename internal references to contributionTypeId

4 years agoRemove extraneous elses
eileen [Thu, 10 Dec 2020 22:03:34 +0000 (11:03 +1300)]
Remove extraneous elses

This looks like a huge code change but it's just removing meaningless elses and reformatting

4 years agodev/financial#163 Rename / remove internal references to contributionTypeID
eileen [Thu, 10 Dec 2020 21:26:34 +0000 (10:26 +1300)]
dev/financial#163 Rename / remove internal references to contributionTypeID

https://lab.civicrm.org/dev/financial/-/issues/163

4 years agoMerge pull request #19159 from colemanw/api4DynamicJoinFix
Seamus Lee [Thu, 10 Dec 2020 21:08:50 +0000 (08:08 +1100)]
Merge pull request #19159 from colemanw/api4DynamicJoinFix

APIv4 - Fix dynamic bridge joins (used by Search Kit)

4 years agoExtract function to retrieve the membership labels.
eileen [Wed, 21 Oct 2020 10:51:51 +0000 (23:51 +1300)]
Extract function to retrieve the membership labels.

Rather than construct an array (membershipTypes) early on with a db lookup
and pass it around we retrieve the labels when needed using a helper function
to retrieve the values from the already-available array on membership type
details

4 years agoSwitch to non-static functions
eileen [Thu, 10 Dec 2020 20:48:35 +0000 (09:48 +1300)]
Switch to non-static functions

I realise these functions are static so that the formRule can call them - but
the formRule has access to the form object and the intention was obviously always
that the formRule can call functions on the form. This cleans that up:

4 years agoMerge pull request #19161 from seamuslee001/5.33
Seamus Lee [Thu, 10 Dec 2020 20:28:10 +0000 (07:28 +1100)]
Merge pull request #19161 from seamuslee001/5.33

Add release-notes/5.32.1

4 years agoAdd release-notes/5.32.1
Tim Otten [Sat, 5 Dec 2020 07:51:41 +0000 (23:51 -0800)]
Add release-notes/5.32.1

4 years agoMerge pull request #19152 from MegaphoneJon/financial-160
colemanw [Thu, 10 Dec 2020 19:38:19 +0000 (14:38 -0500)]
Merge pull request #19152 from MegaphoneJon/financial-160

financial#160 - set correct from_financial_account_id on an edited fee amount FinancialTrxn

4 years agoAPIv4 - Fix dynamic bridge joins
Coleman Watts [Thu, 10 Dec 2020 19:24:29 +0000 (14:24 -0500)]
APIv4 - Fix dynamic bridge joins

Move ON clause conditions to the first join when they reference the bridge entity itself
Ensure bridge joins work with joining the same table to itself (e.g. Contact to Contact via RelationshipCache)

4 years agodev/core#2159 Handle exceptions in Mail:send class
eileen [Mon, 2 Nov 2020 06:21:16 +0000 (19:21 +1300)]
dev/core#2159 Handle exceptions in Mail:send class

This adds handling for exceptions - allowing the class to be more effectivel swapped out
- need to think a bit more about the messages though

4 years agoMerge pull request #19157 from jgrygierek/feature/add-missing-south-korea-state
Eileen McNaughton [Thu, 10 Dec 2020 19:10:34 +0000 (08:10 +1300)]
Merge pull request #19157 from jgrygierek/feature/add-missing-south-korea-state

Add missing state for South Korea

4 years agoMerge pull request #19158 from demeritcowboy/old-from-to
Eileen McNaughton [Thu, 10 Dec 2020 19:06:04 +0000 (08:06 +1300)]
Merge pull request #19158 from demeritcowboy/old-from-to

Remove code deprecated +1 year ago - case_from_XX / case_to_XXX search parameters

4 years agoremove long-deprecated code
demeritcowboy [Thu, 10 Dec 2020 17:03:05 +0000 (12:03 -0500)]
remove long-deprecated code

4 years agofinancial#160 - set correct from_financial_account_id on an edited fee amount Financi...
Jon Goldberg [Wed, 9 Dec 2020 16:20:05 +0000 (11:20 -0500)]
financial#160 - set correct from_financial_account_id on an edited fee amount FinancialTrxn

4 years agoMerge pull request #19155 from eileenmcnaughton/except2
colemanw [Thu, 10 Dec 2020 14:15:19 +0000 (09:15 -0500)]
Merge pull request #19155 from eileenmcnaughton/except2

Remove meaningless calls to ignoreException

4 years agoMerge pull request #19156 from eileenmcnaughton/vars
colemanw [Thu, 10 Dec 2020 14:14:15 +0000 (09:14 -0500)]
Merge pull request #19156 from eileenmcnaughton/vars

Remove some unused variables

4 years agoadd blank line
Jarosław Grygierek [Thu, 10 Dec 2020 10:36:49 +0000 (11:36 +0100)]
add blank line

4 years agoadd missing state for South Korea
Jarosław Grygierek [Thu, 10 Dec 2020 10:33:58 +0000 (11:33 +0100)]
add missing state for South Korea

4 years agoRemove some unused variables
eileen [Thu, 10 Dec 2020 08:17:09 +0000 (21:17 +1300)]
Remove some unused variables

4 years agoRemove meaningless calls to ignoreException
eileen [Thu, 10 Dec 2020 08:07:05 +0000 (21:07 +1300)]
Remove meaningless calls to ignoreException

The way ignoreException works is the exception mode is called until it is
deconstructed. In other words the result needs to be assigned to a variable
and when it is unset then the exception mode reverts back.

However, over time cleaner-uppers spot these unused variables & remove them -
meaning the line no longer actually does anything. Since these lines are already
borked they can go....

4 years agoMerge pull request #18855 from eileenmcnaughton/record
Eileen McNaughton [Thu, 10 Dec 2020 06:29:34 +0000 (19:29 +1300)]
Merge pull request #18855 from eileenmcnaughton/record

[REF] Simplify membership form code towards simplifying BAO

4 years ago[REF] Simplify membership form code towards simplifying BAO
eileen [Mon, 26 Oct 2020 04:05:58 +0000 (17:05 +1300)]
[REF] Simplify membership form code towards simplifying BAO

On digging into the handling for the param relate_contribution_id in the BAO I found it is called
only from the membership form & it's really a hack for the way price sets were super-imposed on the form.

This has really solid testing in testTwoInheritedMembershipsViaPriceSetInBackend (Thanks @davejenx)
and stepping through there is the best way to make sense of it.

What is happening is that if there are 2 memberships in a price set Membership.create is called twice.

However, because the parameter contribution_status_id is passed in it attempts to create the contribution
twice. If we don't add this the second time then we wind up with the second membership payment not created
because that membership didn't exist the first round. So, an extra param relate_contribution_id got
added which says 'if this is passed in create the MembershipPayment record that didn't get created
the first time with the contribution id that we just did a lookup on.

All of this is needed because we create the contribution between the first Membership create
and the second. This removes both magic params from the create, and instead calls
recordMembershipContribution after both are done. I thought about calling Order.create or
just Contribution.create here but there is stuff to unravel around the soft credit creation
being done in RecordMembershipContribution and I am not yet clear if tests are adequate there

4 years agoMerge pull request #19154 from civicrm/5.33
Seamus Lee [Thu, 10 Dec 2020 01:17:02 +0000 (12:17 +1100)]
Merge pull request #19154 from civicrm/5.33

5.33

4 years agoMerge pull request #19115 from totten/master-api4-perm
Seamus Lee [Thu, 10 Dec 2020 00:22:58 +0000 (11:22 +1100)]
Merge pull request #19115 from totten/master-api4-perm

APIv4 - Add "Permission.get" for listing available permissions

4 years agoMerge pull request #18794 from eileenmcnaughton/need_less
Monish Deb [Thu, 10 Dec 2020 00:21:34 +0000 (05:51 +0530)]
Merge pull request #18794 from eileenmcnaughton/need_less

Membership BAO - do not require date fields to be passed in on update

4 years agoMerge pull request #19146 from JMAConsulting/issue-2174
Eileen McNaughton [Thu, 10 Dec 2020 00:15:17 +0000 (13:15 +1300)]
Merge pull request #19146 from JMAConsulting/issue-2174

core#2174: Activity Summary report is missing pagination

4 years agoMerge pull request #18838 from eileenmcnaughton/vrenew
Seamus Lee [Wed, 9 Dec 2020 23:51:36 +0000 (10:51 +1100)]
Merge pull request #18838 from eileenmcnaughton/vrenew

dev/core#2024 extra line item issue on membership renewal

4 years agoMerge pull request #19120 from eileenmcnaughton/fee
Seamus Lee [Wed, 9 Dec 2020 23:10:05 +0000 (10:10 +1100)]
Merge pull request #19120 from eileenmcnaughton/fee

Handle possibility of fee_amount = ''

4 years agoMerge pull request #19149 from seamuslee001/pager_notice_fix
Eileen McNaughton [Wed, 9 Dec 2020 22:49:06 +0000 (11:49 +1300)]
Merge pull request #19149 from seamuslee001/pager_notice_fix

Fix notice error on using max() with only one variable

4 years agoMerge pull request #19109 from eileenmcnaughton/cull
Seamus Lee [Wed, 9 Dec 2020 22:45:59 +0000 (09:45 +1100)]
Merge pull request #19109 from eileenmcnaughton/cull

Remove extraneous handling duplicated from createProfileContact

4 years agoAfform - Export list of synthetic permissions
Tim Otten [Fri, 4 Dec 2020 05:51:57 +0000 (21:51 -0800)]
Afform - Export list of synthetic permissions

4 years agoAPIv4 - Add "Permission.get" test. Include BD/D7/D8/WP variants.
Tim Otten [Fri, 4 Dec 2020 07:35:06 +0000 (23:35 -0800)]
APIv4 - Add "Permission.get" test. Include BD/D7/D8/WP variants.

4 years agoAPIv4 - Add "Permission.get" for browsing available permissions.
Tim Otten [Fri, 4 Dec 2020 07:34:44 +0000 (23:34 -0800)]
APIv4 - Add "Permission.get" for browsing available permissions.

4 years agoCRM_Core_Permission_* - Add getAvailablePermision(). Implement on BD/D7/D8/WP.
Tim Otten [Fri, 4 Dec 2020 07:05:25 +0000 (23:05 -0800)]
CRM_Core_Permission_* - Add getAvailablePermision(). Implement on BD/D7/D8/WP.

4 years agoMerge pull request #19153 from civicrm/5.33
Eileen McNaughton [Wed, 9 Dec 2020 22:21:52 +0000 (11:21 +1300)]
Merge pull request #19153 from civicrm/5.33

5.33

4 years agoMerge pull request #19150 from colemanw/searchKitJoins
Eileen McNaughton [Wed, 9 Dec 2020 20:44:19 +0000 (09:44 +1300)]
Merge pull request #19150 from colemanw/searchKitJoins

Search kit joins

4 years agoRemove extraneous handling duplicated from createProfileContact
eileen [Fri, 4 Dec 2020 02:33:21 +0000 (15:33 +1300)]
Remove extraneous handling duplicated from createProfileContact

I checked and tag and group are not available as import fields

While it's possible to add a contact to a group or tag them that is done elsewhere
- see
https://github.com/civicrm/civicrm-core/blob/0a66a182969ae3fde9f8e54308c4a35fa415685b/CRM/Contact/Import/ImportJob.php#L248

4 years agoMerge pull request #19148 from civicrm/5.33
Seamus Lee [Wed, 9 Dec 2020 19:18:23 +0000 (06:18 +1100)]
Merge pull request #19148 from civicrm/5.33

5.33

4 years agoMerge pull request #18995 from lucky091588/2199_ufgroup_pre_post_hook
Seamus Lee [Wed, 9 Dec 2020 19:14:07 +0000 (06:14 +1100)]
Merge pull request #18995 from lucky091588/2199_ufgroup_pre_post_hook

Add pre() and post() hooks for ufgroup entity

4 years agoSearch kit: bump version
Coleman Watts [Wed, 9 Dec 2020 15:08:43 +0000 (10:08 -0500)]
Search kit: bump version

4 years agoSearch kit: Improve labels & relevance of smart group field selection
Coleman Watts [Wed, 9 Dec 2020 14:27:16 +0000 (09:27 -0500)]
Search kit: Improve labels & relevance of smart group field selection