civicrm-core.git
5 years agoMerge pull request #13768 from eileenmcnaughton/activity_yay
colemanw [Mon, 18 Mar 2019 23:40:39 +0000 (19:40 -0400)]
Merge pull request #13768 from eileenmcnaughton/activity_yay

Activity tab performance fix - switch to faster getActivities & getActivitiesCount

5 years agoMerge pull request #13259 from agh1/disabled-expired-mem
Eileen McNaughton [Mon, 18 Mar 2019 22:35:15 +0000 (11:35 +1300)]
Merge pull request #13259 from agh1/disabled-expired-mem

Disabling or deleting Expired status breaks membership status update

5 years agoCiviMember: test renaming `expired` doesn't trip up status update
Andrew Hunt [Mon, 18 Mar 2019 21:21:06 +0000 (17:21 -0400)]
CiviMember: test renaming `expired` doesn't trip up status update

5 years agoMerge pull request #13545 from pradpnayak/ContactSubType
Eileen McNaughton [Mon, 18 Mar 2019 19:59:20 +0000 (08:59 +1300)]
Merge pull request #13545 from pradpnayak/ContactSubType

"Contact Sub Type" dropdown disappears when fields validation occurs

5 years agoCiviMember: excluding Expired memberships by name, not label
Andrew Hunt [Mon, 18 Mar 2019 16:03:38 +0000 (12:03 -0400)]
CiviMember: excluding Expired memberships by name, not label

5 years agoDisplay contact sub type always
Pradeep Nayak [Tue, 5 Feb 2019 20:49:28 +0000 (20:49 +0000)]
Display contact sub type always

5 years agoMerge pull request #13851 from eileenmcnaughton/opt
Eileen McNaughton [Mon, 18 Mar 2019 06:14:53 +0000 (19:14 +1300)]
Merge pull request #13851 from eileenmcnaughton/opt

Code cleanup on membership block loop

5 years agoMerge pull request #13795 from kewljuice/issue_788
Eileen McNaughton [Mon, 18 Mar 2019 04:59:28 +0000 (17:59 +1300)]
Merge pull request #13795 from kewljuice/issue_788

refs issue 788 fix Warning: A non-numeric value encountered in ...

5 years agoCode cleanup on membership block loop
Matthew Wire (MJW Consulting) [Mon, 18 Mar 2019 04:44:21 +0000 (17:44 +1300)]
Code cleanup on membership block loop

5 years agoMerge pull request #13742 from jitendrapurohit/core-771
Eileen McNaughton [Mon, 18 Mar 2019 02:46:43 +0000 (15:46 +1300)]
Merge pull request #13742 from jitendrapurohit/core-771

dev/core#771 - Smart group with uf_group_id does not load contacts wi…

5 years agoMerge pull request #13508 from spalmstr/core-688
Eileen McNaughton [Mon, 18 Mar 2019 01:40:50 +0000 (14:40 +1300)]
Merge pull request #13508 from spalmstr/core-688

Core-688 - Contacts - New Email Fix Smarty/plugins/function.crmSettin…

5 years agoMerge pull request #13237 from MegaphoneJon/core-571
Eileen McNaughton [Mon, 18 Mar 2019 01:10:30 +0000 (14:10 +1300)]
Merge pull request #13237 from MegaphoneJon/core-571

core#571 - check logged in OR checksum user permissions to edit recur…

5 years agoMerge pull request #13554 from kewljuice/patch-3
Eileen McNaughton [Mon, 18 Mar 2019 00:54:49 +0000 (13:54 +1300)]
Merge pull request #13554 from kewljuice/patch-3

dev/core#706 Edit contribution : wrong decimal separator on total_amount for participant(s)

5 years agoMerge pull request #13848 from eileenmcnaughton/report_temp2
Eileen McNaughton [Sun, 17 Mar 2019 23:52:51 +0000 (12:52 +1300)]
Merge pull request #13848 from eileenmcnaughton/report_temp2

Use TempTable methods - contribution detail

5 years agoMerge pull request #13462 from greenpeace-cee/alter-indexes
Eileen McNaughton [Sun, 17 Mar 2019 23:50:21 +0000 (12:50 +1300)]
Merge pull request #13462 from greenpeace-cee/alter-indexes

dev/core#664 - CRM/Logging - Add indexes when updating log schema

5 years agodev/core#789 - Bug fix for event reg error when skipping participants (#13800)
Martin [Sun, 17 Mar 2019 23:47:49 +0000 (19:47 -0400)]
dev/core#789 - Bug fix for event reg error when skipping participants (#13800)

5 years agoMerge pull request #13847 from eileenmcnaughton/report_temp
Eileen McNaughton [Sun, 17 Mar 2019 23:06:15 +0000 (12:06 +1300)]
Merge pull request #13847 from eileenmcnaughton/report_temp

Use TempTable methods - bookkeeping report

5 years agoMerge pull request #13603 from pradpnayak/AdvMailin
Eileen McNaughton [Sun, 17 Mar 2019 22:58:51 +0000 (11:58 +1300)]
Merge pull request #13603 from pradpnayak/AdvMailin

dev/core/issues/726, Fixed fatal error when searched using group type

5 years agoUse TempTable methods.
mark burdett [Thu, 14 Mar 2019 23:42:46 +0000 (16:42 -0700)]
Use TempTable methods.

5 years agoUse TempTable methods - bookkeeping report
mark burdett [Sun, 17 Mar 2019 21:54:07 +0000 (10:54 +1300)]
Use TempTable methods - bookkeeping report

5 years agoMerge pull request #13845 from seamuslee001/purify_html_tests
Eileen McNaughton [Sun, 17 Mar 2019 21:42:37 +0000 (10:42 +1300)]
Merge pull request #13845 from seamuslee001/purify_html_tests

Add in tests of purifying HTML output

5 years agoMerge pull request #13842 from seamuslee001/upgrade_log_package
Eileen McNaughton [Sun, 17 Mar 2019 20:29:57 +0000 (09:29 +1300)]
Merge pull request #13842 from seamuslee001/upgrade_log_package

Remove Log.php require_once statements

5 years agoAdd in tests of purifying HTML output
Seamus Lee [Sat, 16 Mar 2019 22:35:39 +0000 (09:35 +1100)]
Add in tests of purifying HTML output

Fix up test to work with earlier html purfier

5 years agoEnsure that all original Log Files are removed especially on Joomla
Seamus Lee [Sat, 16 Mar 2019 21:36:22 +0000 (08:36 +1100)]
Ensure that all original Log Files are removed especially on Joomla

5 years agoRemove require_once statements
Seamus Lee [Sat, 16 Mar 2019 01:56:22 +0000 (12:56 +1100)]
Remove require_once statements

5 years agoMerge pull request #13807 from eileenmcnaughton/merge_perm
Seamus Lee [Sat, 16 Mar 2019 06:53:43 +0000 (17:53 +1100)]
Merge pull request #13807 from eileenmcnaughton/merge_perm

Fix contact.merge api to pass check_permissions parameter through to the deeper layer

5 years agoMerge pull request #13839 from eileenmcnaughton/invoicing
Seamus Lee [Sat, 16 Mar 2019 06:52:10 +0000 (17:52 +1100)]
Merge pull request #13839 from eileenmcnaughton/invoicing

Minor code cleanup

5 years agoMerge pull request #13838 from eileenmcnaughton/ids
Seamus Lee [Sat, 16 Mar 2019 06:50:24 +0000 (17:50 +1100)]
Merge pull request #13838 from eileenmcnaughton/ids

Minor code cleanup - remove unnecessary ids declaration

5 years agoMerge pull request #13835 from seamuslee001/upgrade_log_package
Eileen McNaughton [Sat, 16 Mar 2019 06:39:30 +0000 (19:39 +1300)]
Merge pull request #13835 from seamuslee001/upgrade_log_package

Deploy PEAR Log package and upgrade to latest version in the process

5 years agoMerge pull request #13841 from seamuslee001/dismaker_amavisd
Eileen McNaughton [Sat, 16 Mar 2019 03:10:06 +0000 (16:10 +1300)]
Merge pull request #13841 from seamuslee001/dismaker_amavisd

Remove amavisd now that it is removed from the packages repository

5 years agoMerge pull request #13836 from eileenmcnaughton/session
Seamus Lee [Sat, 16 Mar 2019 01:52:18 +0000 (12:52 +1100)]
Merge pull request #13836 from eileenmcnaughton/session

[NFC] remove unnecessary variable

5 years agoRemove amavisd now that it is removed from the packages repository
Seamus Lee [Sat, 16 Mar 2019 01:29:48 +0000 (12:29 +1100)]
Remove amavisd now that it is removed from the packages repository

5 years agoMerge pull request #13832 from eileenmcnaughton/logging
Seamus Lee [Fri, 15 Mar 2019 22:21:49 +0000 (09:21 +1100)]
Merge pull request #13832 from eileenmcnaughton/logging

Logging - attempt to fix tests

5 years agoMerge pull request #13823 from eileenmcnaughton/import_date_test
Seamus Lee [Fri, 15 Mar 2019 22:20:38 +0000 (09:20 +1100)]
Merge pull request #13823 from eileenmcnaughton/import_date_test

Import date test

5 years agoMinor code cleanup
eileen [Fri, 15 Mar 2019 22:19:45 +0000 (11:19 +1300)]
Minor code cleanup

Invoicing code has been poorly integrated into CiviCRM with much copy & paste,
no following of settings spec and an awful lot of outright hacking.

This is a small step towards moving invoice logic to a centralised place -
specifically in this case the unpacking of the non-standard settings that have been
used. Perhaps once using these functions we can standardise them!

Ideally I'd like to see all the invoicing assigns in a function on this
class, better yet once which mimics the pre or buildForm hook & even
better one day to grow up & be a real hook

5 years agoMinor code cleanup - remove unnecessary ids declaration
eileen [Fri, 15 Mar 2019 21:31:50 +0000 (10:31 +1300)]
Minor code cleanup - remove unnecessary ids declaration

 is not used  is only used to set ['id'] so this can be simplified

5 years ago[NFC] remove unnecessary variable
eileen [Fri, 15 Mar 2019 21:11:45 +0000 (10:11 +1300)]
[NFC] remove unnecessary variable

5 years agoDeploy PEAR Log package and upgrade to latest version in the process
Seamus Lee [Fri, 15 Mar 2019 21:09:55 +0000 (08:09 +1100)]
Deploy PEAR Log package and upgrade to latest version in the process

5 years agoMerge pull request #13793 from mattwire/case_links_refactor
Eileen McNaughton [Fri, 15 Mar 2019 20:59:55 +0000 (09:59 +1300)]
Merge pull request #13793 from mattwire/case_links_refactor

REF Extract case action links into a separate function to facilitate refactoring

5 years agoMerge pull request #13834 from civicrm/5.12
Eileen McNaughton [Fri, 15 Mar 2019 20:54:59 +0000 (09:54 +1300)]
Merge pull request #13834 from civicrm/5.12

5.12

5 years agoMerge pull request #13825 from mlutfy/dev801-5-12
Eileen McNaughton [Fri, 15 Mar 2019 20:53:40 +0000 (09:53 +1300)]
Merge pull request #13825 from mlutfy/dev801-5-12

dev/core#801 Fix from email on PDF Letters, such as Thank You Letters.

5 years agoMerge pull request #13833 from civicrm/5.12
Eileen McNaughton [Fri, 15 Mar 2019 20:41:29 +0000 (09:41 +1300)]
Merge pull request #13833 from civicrm/5.12

5.12 to master

5 years agoMerge pull request #13820 from colemanw/dev/core#790
Eileen McNaughton [Fri, 15 Mar 2019 20:40:55 +0000 (09:40 +1300)]
Merge pull request #13820 from colemanw/dev/core#790

dev/core#790 - Exclue menubar on frontend pages

5 years agoMerge pull request #13826 from totten/5.12-assettest-geturl
Eileen McNaughton [Fri, 15 Mar 2019 20:38:51 +0000 (09:38 +1300)]
Merge pull request #13826 from totten/5.12-assettest-geturl

(NFC, infra/ops#878) AssetBuilderTest - Relax getUrl() assertion for WP compat

5 years agoAttempt to fix test with 1 second delay
eileen [Fri, 15 Mar 2019 20:36:34 +0000 (09:36 +1300)]
Attempt to fix test with 1 second delay

(note in 'real life' the events are not generally so close together

5 years agoAdd more data when test fails
eileen [Fri, 15 Mar 2019 20:35:03 +0000 (09:35 +1300)]
Add more data when test fails

5 years agoMerge pull request #13830 from mattwire/whitespace_membershipblock
Eileen McNaughton [Fri, 15 Mar 2019 20:30:26 +0000 (09:30 +1300)]
Merge pull request #13830 from mattwire/whitespace_membershipblock

NFC Whitespace cleanup MembershipBlock.tpl

5 years agoWhitespace on MembershipBlock.tpl
Matthew Wire (MJW Consulting) [Fri, 15 Mar 2019 11:02:55 +0000 (11:02 +0000)]
Whitespace on MembershipBlock.tpl

5 years agoMerge pull request #13779 from eileenmcnaughton/test_recur
Eileen McNaughton [Fri, 15 Mar 2019 07:40:30 +0000 (20:40 +1300)]
Merge pull request #13779 from eileenmcnaughton/test_recur

Display test contributions when viewing contributions related to a test recurring contribution

5 years agoMerge pull request #13824 from colemanw/loadScriptCode
Eileen McNaughton [Fri, 15 Mar 2019 07:40:09 +0000 (20:40 +1300)]
Merge pull request #13824 from colemanw/loadScriptCode

Make cacheCode optional in CRM.loadScript

5 years ago--amend
eileen [Fri, 15 Mar 2019 02:29:12 +0000 (15:29 +1300)]
--amend

Change-Id: Icea6f894d7a9e4656beae3cdb4cb5e44842b59b2

5 years agoActivity tab performance fix - switch to faster getActivities & getActivitiesCount
eileen [Tue, 5 Mar 2019 21:42:16 +0000 (10:42 +1300)]
Activity tab performance fix - switch to faster getActivities & getActivitiesCount

The getActivitiesCount & getActivities functions are faster & call permission hooks
but we weren't able to switch to them until we resolved some performance issues
(done) and resolved acl inconsistencies (resolved in 5.12) -we can do this now.

From a performance POV the difference is tab-crashes vs tab resolves quickly
on contacts with > 10k activities

5 years agoMerge pull request #13829 from eileenmcnaughton/revert
Eileen McNaughton [Fri, 15 Mar 2019 02:07:09 +0000 (15:07 +1300)]
Merge pull request #13829 from eileenmcnaughton/revert

[nfc] Attempt to improve false negatives on Logging test

5 years agoAttempt to improve false negatives on Logging test
eileen [Thu, 14 Mar 2019 23:53:42 +0000 (12:53 +1300)]
Attempt to improve false negatives on Logging test

It might be significant that the one I added sleep(1) to before wasn't a fail in this one...

https://test.civicrm.org/job/CiviCRM-Core-PR/25137/

5 years agoDisplay test contributions when viewing contributions related to a test recurring...
eileen [Thu, 7 Mar 2019 05:45:09 +0000 (18:45 +1300)]
Display test contributions when viewing contributions related to a test recurring contribution

5 years agoMerge pull request #13828 from civicrm/5.12
Eileen McNaughton [Thu, 14 Mar 2019 23:37:09 +0000 (12:37 +1300)]
Merge pull request #13828 from civicrm/5.12

5.12 to master

5 years agoMerge pull request #13796 from eileenmcnaughton/exceptions
Eileen McNaughton [Thu, 14 Mar 2019 23:36:38 +0000 (12:36 +1300)]
Merge pull request #13796 from eileenmcnaughton/exceptions

dev/core#659 Catch payment processor exceptions, log, hide, do not return 500 error

5 years agoMerge pull request #13797 from eileenmcnaughton/matt_test
Eileen McNaughton [Thu, 14 Mar 2019 23:29:47 +0000 (12:29 +1300)]
Merge pull request #13797 from eileenmcnaughton/matt_test

Further cleanup on getRelatedMemberships - just get them with the api

5 years ago(NFC, infra/ops#878) AssetBuilderTest - Relax getUrl() assertion for WP compat
Tim Otten [Wed, 13 Mar 2019 19:00:29 +0000 (12:00 -0700)]
(NFC, infra/ops#878) AssetBuilderTest - Relax getUrl() assertion for WP compat

The test ensures that AssetBuilder produces plausible URLs when caching is disabled.

Generated URLs look different in the default `drupal-clean` and `wp-demo` configurations, e.g.

* D7 (drupal-clean): `http://dmaster.bknix:8001/civicrm/asset/builder?an=square.js&ap=...`
* WP (wp-demo): `http://wpmaster.bknix:8001/?page=CiviCRM&q=civicrm%2Fasset%2Fbuilder&an=square.js&ap=...

The assertion in `AssetBuilderTest` was coded in a way that fails on working URLs.

Before
------

The test fails on WP.

After
-----

The test passes on WP.

5 years agodev/core#801 Fix from email on PDF Letters, such as Thank You Letters.
Mathieu Lutfy [Thu, 14 Mar 2019 16:47:31 +0000 (12:47 -0400)]
dev/core#801 Fix from email on PDF Letters, such as Thank You Letters.

5 years agoFix error message handling while we are at it
eileen [Thu, 14 Mar 2019 22:49:42 +0000 (11:49 +1300)]
Fix error message handling while we are at it

Turns out that instead of translating we are passing the error message to a truly silly function

5 years agoAdd unit test to date parsing on import
eileen [Thu, 14 Mar 2019 21:08:02 +0000 (10:08 +1300)]
Add unit test to date parsing on import

This is primarily as a demo of how to test this class.

Basically extract the parts that we want to check the formatting of into manageable
functions. I made the name on the second one pretty generic so slowly all formatting can
be moved into it, with testing.

This would include moving the various bits of work done in
_civicrm_api3_deprecated_formatted_param
into this function - that code really does just belong on this class as it
is not called from anywhere else.

It also does the checking, but not the formatting, for these date fields - sigh

I would have liked to have made the method protected but the mucking around that required
in the test classes didn't seem to justify it

5 years agoCatch payment processor exceptions, log, hide, do not return 500 error
eileen [Sat, 9 Mar 2019 01:41:47 +0000 (14:41 +1300)]
Catch payment processor exceptions, log, hide, do not return 500 error

5 years agoMake cacheCode optional in CRM.loadScript
Coleman Watts [Thu, 14 Mar 2019 22:23:18 +0000 (18:23 -0400)]
Make cacheCode optional in CRM.loadScript

5 years agoMerge pull request #13822 from seamuslee001/update_zeta_composer_lock
Seamus Lee [Thu, 14 Mar 2019 21:41:14 +0000 (08:41 +1100)]
Merge pull request #13822 from seamuslee001/update_zeta_composer_lock

Update lockfile to take into account of civicrm/zetacomponents-mail#4…

5 years agoMerge pull request #13816 from MegaphoneJon/core-798
colemanw [Thu, 14 Mar 2019 21:01:47 +0000 (17:01 -0400)]
Merge pull request #13816 from MegaphoneJon/core-798

core#798 - fix rendering of public-facing prefix/suffix select2

5 years agoUpdate lockfile to take into account of civicrm/zetacomponents-mail#4 being merged
Seamus Lee [Thu, 14 Mar 2019 20:20:48 +0000 (07:20 +1100)]
Update lockfile to take into account of civicrm/zetacomponents-mail#4 being merged

5 years agodev/core#790 - Exclue menubar on frontend pages
Coleman Watts [Thu, 14 Mar 2019 16:38:35 +0000 (12:38 -0400)]
dev/core#790 - Exclue menubar on frontend pages

5 years agoMerge pull request #13778 from eileenmcnaughton/paymetn_next
Monish Deb [Thu, 14 Mar 2019 05:02:01 +0000 (10:32 +0530)]
Merge pull request #13778 from eileenmcnaughton/paymetn_next

[REF] small cleanups on payment.create flow.

5 years agoFurther cleanup on getRelatedMemberships - just get them with the api
eileen [Sun, 10 Mar 2019 23:44:36 +0000 (12:44 +1300)]
Further cleanup on getRelatedMemberships - just get them with the api

Per work by Matt it makes sense to just retrieve as an api rather than
do weird object wrangling. This is intended to not change the logic about what is fetched

5 years agoMerge pull request #13799 from mfb/zetacomponents
Eileen McNaughton [Thu, 14 Mar 2019 04:33:15 +0000 (17:33 +1300)]
Merge pull request #13799 from mfb/zetacomponents

Upgrade zetacomponents/base and zetacomponents/mail

5 years agoMerge pull request #13802 from mattwire/membership_address
Eileen McNaughton [Thu, 14 Mar 2019 04:28:16 +0000 (17:28 +1300)]
Merge pull request #13802 from mattwire/membership_address

Membership form address fields for payment processors

5 years agoMerge pull request #13703 from mfb/form-temp-tables
Eileen McNaughton [Wed, 13 Mar 2019 23:17:39 +0000 (12:17 +1300)]
Merge pull request #13703 from mfb/form-temp-tables

Use temp table methods; provide TempTable::getCreateSql() method for debugging

5 years agoMerge pull request #13818 from civicrm/5.12
Eileen McNaughton [Wed, 13 Mar 2019 23:13:47 +0000 (12:13 +1300)]
Merge pull request #13818 from civicrm/5.12

5.12 to master

5 years agoMerge pull request #13810 from totten/master-wp-stdrr
Eileen McNaughton [Wed, 13 Mar 2019 23:12:58 +0000 (12:12 +1300)]
Merge pull request #13810 from totten/master-wp-stdrr

(ops#878) phpunit.xml.dist - Prevent conflict in WordPress E2E with "stderr=true"

5 years agoMerge pull request #13811 from totten/master-wp-loadboot
Eileen McNaughton [Wed, 13 Mar 2019 23:10:56 +0000 (12:10 +1300)]
Merge pull request #13811 from totten/master-wp-loadboot

(ops#878) Enforce common signature for CRM_Utils_System::loadBootStrap(). Fix WP E2E error.

5 years agoMerge pull request #13801 from eileenmcnaughton/5.12
Seamus Lee [Wed, 13 Mar 2019 21:14:43 +0000 (08:14 +1100)]
Merge pull request #13801 from eileenmcnaughton/5.12

Fix unrelased regression where activity date relative filters are ingnored in the rc

5 years agoMerge pull request #13383 from seamuslee001/report_cleanup_mailing_summary
Seamus Lee [Wed, 13 Mar 2019 19:48:54 +0000 (06:48 +1100)]
Merge pull request #13383 from seamuslee001/report_cleanup_mailing_summary

(dev/core#491) Standardise the adding of campaign fields on the maili…

5 years agoMerge pull request #13814 from mattwire/testentity
Eileen McNaughton [Wed, 13 Mar 2019 19:43:33 +0000 (08:43 +1300)]
Merge pull request #13814 from mattwire/testentity

Add a class to handle test entities consistently

5 years agoPass 'check permissions' flag through to merge function
eileen [Wed, 13 Mar 2019 02:00:35 +0000 (15:00 +1300)]
Pass 'check permissions' flag through to merge function

The inner function will only delete the merged contact if checkPermissions is false or
the logged in user has permission to delete. Our api model expects check_permissions to be
respected at the BAO level

5 years agoMerge pull request #13812 from mattwire/corepayment_comments
Eileen McNaughton [Wed, 13 Mar 2019 19:14:02 +0000 (08:14 +1300)]
Merge pull request #13812 from mattwire/corepayment_comments

Add comments about usage for doPayment() function

5 years agoMerge pull request #13817 from civicrm/5.12
Eileen McNaughton [Wed, 13 Mar 2019 19:13:11 +0000 (08:13 +1300)]
Merge pull request #13817 from civicrm/5.12

5.12 to master

5 years agoMerge pull request #13808 from totten/5.12-wp-e2e
Eileen McNaughton [Wed, 13 Mar 2019 19:12:14 +0000 (08:12 +1300)]
Merge pull request #13808 from totten/5.12-wp-e2e

(ops#878) (Fast)ArrayDecorator - Emit expected exception when using WP and strict PSR-16

5 years ago(ops#878) Enforce common signature for CRM_Utils_System::loadBootStrap(). Fix WP...
Tim Otten [Wed, 13 Mar 2019 07:35:54 +0000 (00:35 -0700)]
(ops#878) Enforce common signature for CRM_Utils_System::loadBootStrap(). Fix WP E2E error.

Before
------

1.  Most `CRM_Utils_System_*` classes implement a method `loadBootStrap($params = array(),...)`.  However, `WordPress`
   and `UnitTests` implement a different signature (`loadBootStrap($name = NULL, $pass = NULL)`), and `Soap` does not
   implement it all.  This is problematic -- because the function is invoked in a centralized way (e.g.
   `CRM_Utils_System::loadBootStrap()` invokes `$config->userSystem->loadBootStrap($params, $loadUser, $throwError,
   $realPath)`), which implies that all UF drivers need to support this signature.

2. When running any of the end-to-end (E2E) tests on CiviCRM-WordPress, the output is polluted with these warnings:

```
bknix-dfl:~/bknix/build/wpmaster/wp-content/plugins/civicrm/civicrm] phpunit5 tests/phpunit/E2E/Cache/FastArrayDecoratorTest.php ; echo "exit=$?"
PHPUnit 5.7.27 by Sebastian Bergmann and contributors.

PHP Warning:  strip_tags() expects parameter 1 to be string, array given in /Users/totten/bknix/build/wpmaster/wp-includes/formatting.php on line 4649
PHP Stack trace:
PHP   1. {main}() /Users/totten/bknix/civicrm-buildkit/extern/phpunit5/phpunit5.phar:0
PHP   2. PHPUnit_TextUI_Command::main() /Users/totten/bknix/civicrm-buildkit/extern/phpunit5/phpunit5.phar:598
PHP   3. PHPUnit_TextUI_Command->run() phar:///Users/totten/bknix/civicrm-buildkit/extern/phpunit5/phpunit5.phar/phpunit/TextUI/Command.php:116
PHP   4. PHPUnit_TextUI_TestRunner->doRun() phar:///Users/totten/bknix/civicrm-buildkit/extern/phpunit5/phpunit5.phar/phpunit/TextUI/Command.php:186
PHP   5. PHPUnit_Framework_TestSuite->run() phar:///Users/totten/bknix/civicrm-buildkit/extern/phpunit5/phpunit5.phar/phpunit/TextUI/TestRunner.php:517
PHP   6. call_user_func:{phar:///Users/totten/bknix/civicrm-buildkit/extern/phpunit5/phpunit5.phar/phpunit/Framework/TestSuite.php:679}() phar:///Users/totten/bknix/civicrm-buildkit/extern/phpunit5/phpunit5.phar/phpunit/Framework/TestSuite.php:679
PHP   7. E2E_Cache_CacheTestCase::setUpBeforeClass() phar:///Users/totten/bknix/civicrm-buildkit/extern/phpunit5/phpunit5.phar/phpunit/Framework/TestSuite.php:679
PHP   8. CRM_Utils_System::loadBootStrap() /Users/totten/bknix/build/wpmaster/wp-content/plugins/civicrm/civicrm/tests/phpunit/E2E/Cache/CacheTestCase.php:43
PHP   9. CRM_Utils_System_WordPress->loadBootStrap() /Users/totten/bknix/build/wpmaster/wp-content/plugins/civicrm/civicrm/CRM/Utils/System.php:1477
PHP  10. wp_authenticate() /Users/totten/bknix/build/wpmaster/wp-content/plugins/civicrm/civicrm/CRM/Utils/System/WordPress.php:495
PHP  11. sanitize_user() /Users/totten/bknix/build/wpmaster/wp-includes/pluggable.php:515
PHP  12. wp_strip_all_tags() /Users/totten/bknix/build/wpmaster/wp-includes/formatting.php:1850
PHP  13. strip_tags() /Users/totten/bknix/build/wpmaster/wp-includes/formatting.php:4649

Warning: strip_tags() expects parameter 1 to be string, array given in /Users/totten/bknix/build/wpmaster/wp-includes/formatting.php on line 4649

Call Stack:
    0.0026     425040   1. {main}() /Users/totten/bknix/civicrm-buildkit/extern/phpunit5/phpunit5.phar:0
    0.0766   14246216   2. PHPUnit_TextUI_Command::main() /Users/totten/bknix/civicrm-buildkit/extern/phpunit5/phpunit5.phar:598
    0.0766   14246952   3. PHPUnit_TextUI_Command->run() phar:///Users/totten/bknix/civicrm-buildkit/extern/phpunit5/phpunit5.phar/phpunit/TextUI/Command.php:116
    0.4267   23405608   4. PHPUnit_TextUI_TestRunner->doRun() phar:///Users/totten/bknix/civicrm-buildkit/extern/phpunit5/phpunit5.phar/phpunit/TextUI/Command.php:186
    0.4336   23511184   5. PHPUnit_Framework_TestSuite->run() phar:///Users/totten/bknix/civicrm-buildkit/extern/phpunit5/phpunit5.phar/phpunit/TextUI/TestRunner.php:517
    0.4403   23516840   6. call_user_func:{phar:///Users/totten/bknix/civicrm-buildkit/extern/phpunit5/phpunit5.phar/phpunit/Framework/TestSuite.php:679}() phar:///Users/totten/bknix/civicrm-buildkit/extern/phpunit5/phpunit5.phar/phpunit/Framework/TestSuite.php:679
    0.4403   23516920   7. E2E_Cache_CacheTestCase::setUpBeforeClass() phar:///Users/totten/bknix/civicrm-buildkit/extern/phpunit5/phpunit5.phar/phpunit/Framework/TestSuite.php:679
    0.5065   31975824   8. CRM_Utils_System::loadBootStrap() /Users/totten/bknix/build/wpmaster/wp-content/plugins/civicrm/civicrm/tests/phpunit/E2E/Cache/CacheTestCase.php:43
    0.5065   31976344   9. CRM_Utils_System_WordPress->loadBootStrap() /Users/totten/bknix/build/wpmaster/wp-content/plugins/civicrm/civicrm/CRM/Utils/System.php:1477
    0.6517   57998912  10. wp_authenticate() /Users/totten/bknix/build/wpmaster/wp-content/plugins/civicrm/civicrm/CRM/Utils/System/WordPress.php:495
    0.6517   57998992  11. sanitize_user() /Users/totten/bknix/build/wpmaster/wp-includes/pluggable.php:515
    0.6517   57999088  12. wp_strip_all_tags() /Users/totten/bknix/build/wpmaster/wp-includes/formatting.php:1850
    0.6517   57999736  13. strip_tags() /Users/totten/bknix/build/wpmaster/wp-includes/formatting.php:4649
```

3.  The warning indicates that (on WordPress) the E2E test is not doing what it's trying to do -- specifically,
    `E2E_Cache_CacheTestCase::setUpBeforeClass()` (or, similarly, `CiviEndToEndTestCase::setUpBeforeClass()`) calls
    `CRM_Utils_System::loadBootStrap()` to authenticate as the CMS administrator, but this fails because WP's
    implementation of `loadBootStrap()` does not respect the same signature.

After
-----

1. `CRM_Utils_System_Base` defines an abstract function `loadBootStrap($params = array(),...)`. Any non-compliant driver (which
   uses a different signature or which omits the function) will produce a syntax error.

2. The classes `CRM_Utils_System_{WordPress,UnitTests}` have been updated to comply with the signature.

3. The class `CRM_Utils_System_Soap` nominally complies. However, this class isn't really a UF driver, and it doesn't make sense for
   it to extend this base class, and the implementation is a stub. But we don't need to scope-creep the bugfix.

4. The `loadBootStrap...strip_tags()...` warnings are no longer generated when running E2E tests on WP.

Comments
--------

* I verified that all extant classes in `CRM/Utils/System/*.php` are loadable/compilable (i.e they now comply with the delcared signature).
* The SOAP integration has test-coverage viia `E2E_Extern_SoapTest`.
* In the PR test output, you'll only see E2E results from D7.  *However*, this patch is part of a bigger effort
  (infrastructure/ops#878) which will eventually give some visibility on that.

5 years agocore#798 - fix rendering of public-facing prefix/suffix select2
Jon Goldberg [Wed, 13 Mar 2019 16:12:41 +0000 (12:12 -0400)]
core#798 - fix rendering of public-facing prefix/suffix select2

5 years agoAdd a class to handle test entities consistently
Matthew Wire (MJW Consulting) [Wed, 13 Mar 2019 14:00:14 +0000 (14:00 +0000)]
Add a class to handle test entities consistently

5 years agoAdd comments about usage for doPayment() function
Matthew Wire (MJW Consulting) [Wed, 13 Mar 2019 10:29:57 +0000 (10:29 +0000)]
Add comments about usage for doPayment() function

5 years ago(ops#878) phpunit.xml.dist - Prevent conflict in WordPress E2E with "stderr=true"
Tim Otten [Wed, 13 Mar 2019 07:16:43 +0000 (00:16 -0700)]
(ops#878) phpunit.xml.dist - Prevent conflict in WordPress E2E with "stderr=true"

Before
------

When running any of the end-to-end (E2E) tests on CiviCRM-WordPress, the output is polluted with these warnings:

```
[bknix-dfl:~/bknix/build/wpmaster/wp-content/plugins/civicrm/civicrm] phpunit5 tests/phpunit/E2E/Cache/FastArrayDecoratorTest.php
PHPUnit 5.7.27 by Sebastian Bergmann and contributors.

PHP Warning:  session_start(): Cannot send session cookie - headers already sent by (output started at phar:///Users/totten/bknix/civicrm-buildkit/extern/phpunit5/phpunit5.phar/phpunit/Util/Printer.php:110) in /Users/totten/bknix/build/wpmaster/wp-content/plugins/civicrm/civicrm.php on line 346
PHP Stack trace:
PHP   1. {main}() /Users/totten/bknix/civicrm-buildkit/extern/phpunit5/phpunit5.phar:0
PHP   2. PHPUnit_TextUI_Command::main() /Users/totten/bknix/civicrm-buildkit/extern/phpunit5/phpunit5.phar:598
PHP   3. PHPUnit_TextUI_Command->run() phar:///Users/totten/bknix/civicrm-buildkit/extern/phpunit5/phpunit5.phar/phpunit/TextUI/Command.php:116
PHP   4. PHPUnit_TextUI_TestRunner->doRun() phar:///Users/totten/bknix/civicrm-buildkit/extern/phpunit5/phpunit5.phar/phpunit/TextUI/Command.php:186
PHP   5. PHPUnit_Framework_TestSuite->run() phar:///Users/totten/bknix/civicrm-buildkit/extern/phpunit5/phpunit5.phar/phpunit/TextUI/TestRunner.php:517
PHP   6. call_user_func:{phar:///Users/totten/bknix/civicrm-buildkit/extern/phpunit5/phpunit5.phar/phpunit/Framework/TestSuite.php:679}() phar:///Users/totten/bknix/civicrm-buildkit/extern/phpunit5/phpunit5.phar/phpunit/Framework/TestSuite.php:679
PHP   7. E2E_Cache_CacheTestCase::setUpBeforeClass() phar:///Users/totten/bknix/civicrm-buildkit/extern/phpunit5/phpunit5.phar/phpunit/Framework/TestSuite.php:679
PHP   8. CRM_Utils_System::loadBootStrap() /Users/totten/bknix/build/wpmaster/wp-content/plugins/civicrm/civicrm/tests/phpunit/E2E/Cache/CacheTestCase.php:43
PHP   9. CRM_Utils_System_WordPress->loadBootStrap() /Users/totten/bknix/build/wpmaster/wp-content/plugins/civicrm/civicrm/CRM/Utils/System.php:1477
PHP  10. require_once() /Users/totten/bknix/build/wpmaster/wp-content/plugins/civicrm/civicrm/CRM/Utils/System/WordPress.php:479
PHP  11. require_once() /Users/totten/bknix/build/wpmaster/wp-load.php:37
PHP  12. require_once() /Users/totten/bknix/build/wpmaster/wp-config.php:94
PHP  13. do_action() /Users/totten/bknix/build/wpmaster/wp-settings.php:325
PHP  14. WP_Hook->do_action() /Users/totten/bknix/build/wpmaster/wp-includes/plugin.php:453
PHP  15. WP_Hook->apply_filters() /Users/totten/bknix/build/wpmaster/wp-includes/class-wp-hook.php:323
PHP  16. call_user_func_array:{/Users/totten/bknix/build/wpmaster/wp-includes/class-wp-hook.php:298}() /Users/totten/bknix/build/wpmaster/wp-includes/class-wp-hook.php:298
PHP  17. CiviCRM_For_WordPress->setup_instance() /Users/totten/bknix/build/wpmaster/wp-includes/class-wp-hook.php:298
PHP  18. session_start() /Users/totten/bknix/build/wpmaster/wp-content/plugins/civicrm/civicrm.php:346
```

After
-----

The session_start warnings are no longer generated..

Comments
--------

The problem appears to be this:

1. When PHPUnit starts, it puts some messages on STDOUT.
2. When the specific tests/test-suites are setup, they bootstrap WordPress, and WordPress tries to setup a session, which requires setting some headers
3. But we've already started writing STDOUT, and we can't send any headers.

The patch is based on suggestion [a StackExchange
discussion](https://stackoverflow.com/questions/23270650/cannot-send-session-cookie-headers-already-sent-phpunit-laravel/38045422)
-- basically, by setting the `stderr` option (which is documented lightly in the cli `phpunit5 --help`), we prevent
step 1 above -- because PHPUnit now prints messages to STDERR instead of STDOUT.

The only concern (`r-tech`) would be...  is there anything in our ecosystem which depends on piping information from
PHPUnit's STDOUT?  Obviously, I can't speak for third-parties, but the general pattern in `civicrm.org` CI scripts
(e.g.  `civi-test-run`) is to evaluate PHPUnit output through a mix of (1) exit-codes and (2) JUnit files.  In which case...
it doesn't matter if PHPUnit writes messages to STDERR or STDOUT.

I'd suggest paying close attention to the console output for the PR-test here; if that's good, then we're probably OK.

5 years ago(Fast)ArrayDecorator - Emit expected exception when using WP and strict PSR-16
Tim Otten [Wed, 13 Mar 2019 05:15:20 +0000 (22:15 -0700)]
(Fast)ArrayDecorator - Emit expected exception when using WP and strict PSR-16

Suppose someone calls `ArrayDecorator::get()` or `FastArrayDecorator::get()`
with an invalid key (e.g.  passing `float` or an `array` instead of a
`string`).  This patch improves error-reporting for that scenario.

This is primarily about fixing multiple test failures in `E2E_Cache_ArrayDecoratorTest` reported on `wp-demo`. These
generally look like

```
1) E2E_Cache_ArrayDecoratorTest::testGetInvalidKeys with data set #1 (true)
array_key_exists(): The first argument should be either a string or an integer

/Users/totten/bknix/build/wpmaster/wp-content/plugins/civicrm/civicrm/CRM/Utils/Cache/ArrayDecorator.php:102
/Users/totten/bknix/build/wpmaster/wp-content/plugins/civicrm/civicrm/packages/Cache/IntegrationTests/LegacySimpleCacheTest.php:409
/Users/totten/bknix/civicrm-buildkit/extern/phpunit5/phpunit5.phar:598
```

Before
------

The ArrayDecorator first checks its front cache (`array_key_exists`) to see if the key is defined.  In the `wp-demo`
environment, this produces a warning and causes the test to fail.

The condition *is* erroneous, but PSR-16 specifies that the error should be reported as exception.

After
-----

The condition is reported as the expected exception. The test passes on `wp-demo`.

Comment
-------

This brings the code in `(Fast)ArrayDecorator.php` into alignment with most of the other `CRM/Utils/Cache/*.php`
drivers; in most drivers, it is typical to validate the key at the start of most functions.

5 years agoMerge pull request #13806 from eileenmcnaughton/array_form
Tim Otten [Wed, 13 Mar 2019 04:26:58 +0000 (21:26 -0700)]
Merge pull request #13806 from eileenmcnaughton/array_form

[NFC] reformat Contact api file to switch to new array formatting

5 years agoMerge pull request #13803 from herbdool/issue-13788-alt
Eileen McNaughton [Wed, 13 Mar 2019 02:22:17 +0000 (15:22 +1300)]
Merge pull request #13803 from herbdool/issue-13788-alt

 civicrm/admin/setting/uf - Fix advice about Backdrop Views ($database_prefix)

5 years ago[NFC] reformt Contact api file to switch to new array formatting
eileen [Wed, 13 Mar 2019 01:53:16 +0000 (14:53 +1300)]
[NFC] reformt Contact api file to switch to new array formatting

This is just an IDE reformat.  A few tweaks beyond the straight array swap but not much

5 years agoCRM/Admin/Form/Setting/UF.tpl - Change "add" to "add or update"
Tim Otten [Wed, 13 Mar 2019 00:35:08 +0000 (17:35 -0700)]
CRM/Admin/Form/Setting/UF.tpl - Change "add" to "add or update"

If an admin follows the advice literally (and merely *adds* the item),
and if there's already an existing as directive higher-up (as
there would be in a stock Backdrop `settings.php`), then the
`settings.php` would have two copies of the directive.

That'd be liable to cause confusion during subsequent maintenance.

5 years agoMerge pull request #13805 from mattwire/static
Eileen McNaughton [Tue, 12 Mar 2019 22:34:28 +0000 (11:34 +1300)]
Merge pull request #13805 from mattwire/static

checkEditInboundEmailsPermissions should be a static function

5 years ago(dev/core#491) Standardise the adding of campaign fields on the mailing summary repor...
Seamus Lee [Wed, 2 Jan 2019 20:45:16 +0000 (07:45 +1100)]
(dev/core#491) Standardise the adding of campaign fields on the mailing summary report and add a post upgrade message about needing to re-save report given the changes made to the report template

Update language on postupgrade message

Move upgrade to 5.13

5 years agoMerge pull request #13783 from eileenmcnaughton/confirm_btn
Eileen McNaughton [Tue, 12 Mar 2019 20:34:39 +0000 (09:34 +1300)]
Merge pull request #13783 from eileenmcnaughton/confirm_btn

[REF] minor code simplification - remove over-handling of amount comp with zero

5 years agocheckEditInboundEmailsPermissions should be a static function
Matthew Wire (MJW Consulting) [Tue, 12 Mar 2019 17:03:34 +0000 (17:03 +0000)]
checkEditInboundEmailsPermissions should be a static function

5 years agoMerge pull request #13791 from eileenmcnaughton/revert
Eileen McNaughton [Tue, 12 Mar 2019 20:23:17 +0000 (09:23 +1300)]
Merge pull request #13791 from eileenmcnaughton/revert

Attempted test fix

5 years agoMerge pull request #13781 from eileenmcnaughton/title
colemanw [Tue, 12 Mar 2019 20:22:03 +0000 (16:22 -0400)]
Merge pull request #13781 from eileenmcnaughton/title

Standardise setTitle method on forms

5 years agoalt to issue-13788 assign db mapping to database_prefix
Herb vd Dool [Tue, 12 Mar 2019 04:44:59 +0000 (00:44 -0400)]
alt to issue-13788 assign db mapping to database_prefix