civicrm-core.git
5 years agocomposer.json - Import PSR-16 interfaces (psr/simple-cache ~1.0.1)
Tim Otten [Tue, 19 Jun 2018 23:52:47 +0000 (16:52 -0700)]
composer.json - Import PSR-16 interfaces (psr/simple-cache ~1.0.1)

5 years ago(dev/core#174) CRM_Utils_Cache_Interface - Add `has()` (PSR-16)
Tim Otten [Tue, 19 Jun 2018 23:43:21 +0000 (16:43 -0700)]
(dev/core#174) CRM_Utils_Cache_Interface - Add `has()` (PSR-16)

5 years ago(dev/core#174) CRM_Utils_Cache_Interface::clear() is an alias for flush()
Tim Otten [Tue, 19 Jun 2018 23:22:28 +0000 (16:22 -0700)]
(dev/core#174) CRM_Utils_Cache_Interface::clear() is an alias for flush()

flush() is specified by Civi's traditional interface, and clear() is
specified by PSR-16. The semantics should be the same (i.e. remove
any records managed by this cache-object).

This treats flush() and clear() as aliases.

5 years ago(dev/core#174) CRM_Utils_Cache_Interface::delete() - Return bool like PSR-16
Tim Otten [Tue, 19 Jun 2018 23:18:48 +0000 (16:18 -0700)]
(dev/core#174) CRM_Utils_Cache_Interface::delete() - Return bool like PSR-16

The function signature for `delete()` did not specify a return value, and
actual behaviors varied depending on the driver (`bool` for memcache,
`int` for redis, and `void` for others).

This standardizes on returning a bool -- which makes the signature align
with PSR-16's `delete()`.

5 years ago(dev/core#174) CRM_Utils_Cache_Interface::flush() - Return bool like PSR-16
Tim Otten [Tue, 19 Jun 2018 23:06:26 +0000 (16:06 -0700)]
(dev/core#174) CRM_Utils_Cache_Interface::flush() - Return bool like PSR-16

The function signature for `flush()` did not specify a return value, and
actual behaviors varied depending on the driver (`bool` for memcache,
`int` for redis, and `void` for others).

This standardizes on returning a bool -- which makes the signature align
with PSR-16's `clear()`.

5 years ago(dev/core#174) CRM_Utils_Cache_Interface - Add getMultiple/setMultiple (PSR-16)
Tim Otten [Tue, 19 Jun 2018 22:53:46 +0000 (15:53 -0700)]
(dev/core#174) CRM_Utils_Cache_Interface - Add getMultiple/setMultiple (PSR-16)

5 years ago(dev/core#174) CRM_Utils_Cache_Interface::set() should match PSR-16
Tim Otten [Tue, 19 Jun 2018 22:19:01 +0000 (15:19 -0700)]
(dev/core#174) CRM_Utils_Cache_Interface::set() should match PSR-16

Comparing `CRM_Utils_Cache_Interface::set()` and `Psr\SimpleCache\CacheInterface::set()`,
they agree on key details:

1. The first value is a string key.
2. The second value is a mixed field (string or number or array...).
3. The return value should be a boolean indicating success/failure.

There are two differences:

1. Our old interface didn't actually enforce the return-value in all cases. Should be better now.
2. PSR-16 accepts a third argument, `$ttl`, which defaults to `NULL`. In the NULL/default case,
   the semantics are the same (i.e. up to the discretion of the driver).
    1. Since no existing callers actually use this, we can (for moment) throw an
       error if someone tries to pass `$ttl` to a driver that doesn't support it.
3. The `$value` is pass-by-reference. However, this probably doesn't mean anything.
    1. In older Civi code, there was a tendenacy to pass-by-reference without any real
       need -- perhaps just speculation about performance.
    2. Most cache drivers serialize the value and send it elsewhere. References will
       not survive the process. If there's some code/caller/use-case that requires the
       references to work, then it's already broken for most drivers (except maybe `ArrayCache`).
    3. The old signature meant that callers had to say `$bar=123; $cache->set('foo', $bar)` rather than
       `$cache->set('foo', 123)`. This change relaxes the contract -- so that you can pass
       either `$bar` or `123.

See also: https://www.php-fig.org/psr/psr-16/

5 years ago(dev/core#174) CRM_Utils_Cache_Interface::get() should match PSR-16
Tim Otten [Tue, 19 Jun 2018 22:09:08 +0000 (15:09 -0700)]
(dev/core#174) CRM_Utils_Cache_Interface::get() should match PSR-16

Comparing `CRM_Utils_Cache_Interface::get()` and `Psr\SimpleCache\CacheInterface::get()`,
they agree on key details:

1. They return values are `mixed` (strings, arrays, numbers,, etc)
2. The default representation of a cache-miss is NULL.

They differ in that PSR-16 allows the caller to optionally specify a `$default`.

Since no existing callers actually use this, we can (for moment) throw an
error if someone tries to pass `$default` to a driver that doesn't support
it.

See also: https://www.php-fig.org/psr/psr-16/

5 years agoMerge pull request #12348 from totten/master-clean-keys
Seamus Lee [Wed, 27 Jun 2018 21:15:44 +0000 (07:15 +1000)]
Merge pull request #12348 from totten/master-clean-keys

(dev/core#174) Cache-keys for CRM_Utils_Cache_* should avoid reserved chars

5 years agoCivi\Angular\Manager - Use PSR-16 compliant cache key
Tim Otten [Tue, 26 Jun 2018 19:09:11 +0000 (12:09 -0700)]
Civi\Angular\Manager - Use PSR-16 compliant cache key

5 years agoCRM_Contact_BAO_ContactType - Use PSR-16 compliant cache key
Tim Otten [Mon, 25 Jun 2018 23:19:41 +0000 (16:19 -0700)]
CRM_Contact_BAO_ContactType - Use PSR-16 compliant cache key

5 years agoCRM_Core_BAO_CacheTest - Unit test for CRM_Core_BAO_Cache::cleanKey
Tim Otten [Thu, 21 Jun 2018 23:19:37 +0000 (16:19 -0700)]
CRM_Core_BAO_CacheTest - Unit test for CRM_Core_BAO_Cache::cleanKey

5 years agoCRM_ACL_BAO_ACL - Use PSR-16 compliant cache key
Tim Otten [Thu, 21 Jun 2018 08:22:57 +0000 (01:22 -0700)]
CRM_ACL_BAO_ACL - Use PSR-16 compliant cache key

5 years agoCRM_Core_PseudoConstant - Use PSR-16 compliant cache key
Tim Otten [Thu, 21 Jun 2018 08:23:20 +0000 (01:23 -0700)]
CRM_Core_PseudoConstant - Use PSR-16 compliant cache key

5 years agoCRM_Cxn_CiviCxnHttp - Use PSR-16 compliant cache key
Tim Otten [Thu, 21 Jun 2018 08:23:45 +0000 (01:23 -0700)]
CRM_Cxn_CiviCxnHttp - Use PSR-16 compliant cache key

5 years agoCRM_Extension_Mapper - Use PSR-16 compliant cache key
Tim Otten [Thu, 21 Jun 2018 05:39:08 +0000 (22:39 -0700)]
CRM_Extension_Mapper - Use PSR-16 compliant cache key

5 years agoCRM_Core_OptionGroup - Use PSR-16 compliant cache key
Tim Otten [Thu, 21 Jun 2018 05:39:31 +0000 (22:39 -0700)]
CRM_Core_OptionGroup - Use PSR-16 compliant cache key

5 years agoSettingsManager - Use PSR-16 compliant cache key
Tim Otten [Thu, 21 Jun 2018 05:40:06 +0000 (22:40 -0700)]
SettingsManager - Use PSR-16 compliant cache key

5 years agoCRM_Core_BAO_Cache - Use PSR-16 compliant cache key (for extra cache tier)
Tim Otten [Thu, 21 Jun 2018 05:40:36 +0000 (22:40 -0700)]
CRM_Core_BAO_Cache - Use PSR-16 compliant cache key (for extra cache tier)

5 years agoMerge pull request #12354 from totten/master-cache-b64
colemanw [Tue, 26 Jun 2018 23:44:26 +0000 (19:44 -0400)]
Merge pull request #12354 from totten/master-cache-b64

 (dev/core#174) civicrm_cache - Allow storage of binary data

5 years agoMerge pull request #12363 from JMAConsulting/dev-core-41
Eileen McNaughton [Tue, 26 Jun 2018 20:00:07 +0000 (13:00 -0700)]
Merge pull request #12363 from JMAConsulting/dev-core-41

dev/core#41: Added unit test

6 years agodev/core#41: Add unit test
deb.monish [Tue, 26 Jun 2018 09:56:39 +0000 (15:26 +0530)]
dev/core#41: Add unit test

6 years agoMerge pull request #12357 from pradpnayak/issues-203
Eileen McNaughton [Sat, 23 Jun 2018 02:29:18 +0000 (14:29 +1200)]
Merge pull request #12357 from pradpnayak/issues-203

dev/core/issues/203, removed cruft code

6 years agodev/core/issues/203, removed cruft code
Pradeep Nayak [Fri, 22 Jun 2018 14:35:09 +0000 (15:35 +0100)]
dev/core/issues/203, removed cruft code

6 years agoCRM_Core_BAO_Cache - Load/store binary data in cache (via base64)
Tim Otten [Fri, 22 Jun 2018 03:05:04 +0000 (20:05 -0700)]
CRM_Core_BAO_Cache - Load/store binary data in cache (via base64)

6 years agoCRM_Core_BAO_CacheTest - Test more example values
Tim Otten [Thu, 21 Jun 2018 08:43:19 +0000 (01:43 -0700)]
CRM_Core_BAO_CacheTest - Test more example values

6 years agoMerge pull request #12332 from eileenmcnaughton/token
colemanw [Fri, 22 Jun 2018 02:22:04 +0000 (22:22 -0400)]
Merge pull request #12332 from eileenmcnaughton/token

Add support for hidden fields in general (and 'token' specifically) on the payment form.

6 years agoMerge pull request #11241 from mattwire/CRM-21392_find_groups_viewcomponents
Eileen McNaughton [Thu, 21 Jun 2018 21:57:19 +0000 (09:57 +1200)]
Merge pull request #11241 from mattwire/CRM-21392_find_groups_viewcomponents

CRM-21392 Allow viewing groups/smartgroups as as other entities (eg. memberships, events)

6 years agoMerge pull request #12351 from JMAConsulting/dev-core-41
Eileen McNaughton [Thu, 21 Jun 2018 21:34:05 +0000 (09:34 +1200)]
Merge pull request #12351 from JMAConsulting/dev-core-41

dev/core#41: Search Builder: Not empty with date or integer custom fields gives a sql warning

6 years agoMerge pull request #12317 from mattwire/grant_form_task
Eileen McNaughton [Thu, 21 Jun 2018 21:28:25 +0000 (09:28 +1200)]
Merge pull request #12317 from mattwire/grant_form_task

dev/core#187 Fix typo in CRM_Grant_Form_Task that prevents retrieving session key from URL

6 years agodev/core#41: Search Builder: Not empty with date or integer custom fields gives a...
deb.monish [Thu, 21 Jun 2018 11:14:28 +0000 (16:44 +0530)]
dev/core#41: Search Builder: Not empty with date or integer custom fields gives a sql warning

6 years agoMerge pull request #12349 from jitendrapurohit/profilefix
Seamus Lee [Thu, 21 Jun 2018 09:27:01 +0000 (19:27 +1000)]
Merge pull request #12349 from jitendrapurohit/profilefix

Fix profile load on update multiple action

6 years agoFix profile load on update multiple action
Jitendra Purohit [Thu, 21 Jun 2018 06:29:59 +0000 (11:59 +0530)]
Fix profile load on update multiple action

6 years agoMerge pull request #12347 from totten/master-hook-reset
Eileen McNaughton [Thu, 21 Jun 2018 04:12:10 +0000 (16:12 +1200)]
Merge pull request #12347 from totten/master-hook-reset

(NFC) CiviUnitTestCase - Fix edge-case for mis-reported error

6 years agoCiviUnitTestCase - Fix edge-case for mis-reported error
Tim Otten [Thu, 21 Jun 2018 01:16:32 +0000 (18:16 -0700)]
CiviUnitTestCase - Fix edge-case for mis-reported error

Suppose you run a test and it encounters an error very early in process --
e.g.  while processing `setUp()`, before constructing the instance of
`$this->hookClass`.  It then proceeds to `tearDown()`. Later, the test
runner will give you a report on the rrors.

Before
------------

The `tearDown` fails because the missing instance of `$this->hookClass`
raises another error, and test-report shows this misleading reference.

After
------------

The `tearDown` proceeds, and the test-report shows the real cause
of the failure.

6 years agoMerge pull request #12331 from totten/master-default-prefix
Eileen McNaughton [Thu, 21 Jun 2018 00:43:25 +0000 (12:43 +1200)]
Merge pull request #12331 from totten/master-default-prefix

(dev/core#174) CRM_Utils_Cache - Always use a prefix. Standardize delimiter

6 years agoMerge pull request #12228 from MiyaNoctem/CRM-151-fix-actions-on-membership-recurring...
Eileen McNaughton [Wed, 20 Jun 2018 20:23:52 +0000 (08:23 +1200)]
Merge pull request #12228 from MiyaNoctem/CRM-151-fix-actions-on-membership-recurring-contribution-list

dev/core#151: Allow to Edit Recurring Contributions From Membership

6 years agoMerge pull request #12178 from jitendrapurohit/membership-4
Eileen McNaughton [Wed, 20 Jun 2018 19:48:11 +0000 (07:48 +1200)]
Merge pull request #12178 from jitendrapurohit/membership-4

dev/membership#4 - Admin Membership type is displayed on Public contr…

6 years agoCRM-151: Allow to Edit Recurring Contributions From Membership
Camilo Rodriguez [Tue, 29 May 2018 18:12:32 +0000 (18:12 +0000)]
CRM-151: Allow to Edit Recurring Contributions From Membership

A check for payment processor id was causing all recurring contributions shown
on membership details view to never show the 'Edit' action, as this value was
not availble. Fixed by removing check, as it is no longer required.

6 years agoMerge pull request #12341 from eileenmcnaughton/matt
Seamus Lee [Wed, 20 Jun 2018 03:35:10 +0000 (13:35 +1000)]
Merge pull request #12341 from eileenmcnaughton/matt

Remove unused instances of usedTable

6 years agoMerge pull request #12339 from colemanw/colors
Eileen McNaughton [Wed, 20 Jun 2018 02:12:19 +0000 (14:12 +1200)]
Merge pull request #12339 from colemanw/colors

Use html5 color input for contribution page widget

6 years agoRemove unused instances of useTable var
eileen [Wed, 20 Jun 2018 00:38:41 +0000 (12:38 +1200)]
Remove unused instances of useTable var

6 years agoMerge pull request #12316 from mattwire/core_task_code_cleanup
Eileen McNaughton [Wed, 20 Jun 2018 00:21:40 +0000 (12:21 +1200)]
Merge pull request #12316 from mattwire/core_task_code_cleanup

NFC Code cleanup to core task class

6 years agoMerge pull request #12336 from totten/master-status-check
Eileen McNaughton [Tue, 19 Jun 2018 22:27:13 +0000 (10:27 +1200)]
Merge pull request #12336 from totten/master-status-check

(dev/core#174) systemStatusCheckResult - Migrate from settings to cache

6 years agoCRM_Utils_Cache_SqlGroup - Don't encourage infinite recursion
Tim Otten [Fri, 30 Mar 2018 01:57:26 +0000 (18:57 -0700)]
CRM_Utils_Cache_SqlGroup - Don't encourage infinite recursion

The `deleteGroup(...$clearAll...)` option is heavy-handed and leads to
call-paths that hard to grok.

In the current design of CRM_Core_BAO_Cache (with multi-tier caching), one
does need to clear these things.  But let's not clear everything under the
sun...

6 years ago(dev/core#174) System::flushCache() - Continue existing behavior aftering fixing...
Tim Otten [Mon, 18 Jun 2018 21:58:10 +0000 (14:58 -0700)]
(dev/core#174) System::flushCache() - Continue existing behavior aftering fixing prefixes

The preceding update to `CRM_Utils_Cache` meant that `CRM_Utils_Cache::singleton()->flush()`
(aka `Civi::cache()->flush()`) would flush only the *default* cache. This revision
ensures that a general system-flush still hits the same caches.

However, we can now define *other* caches which *won't* be hit by system-flush.

6 years agoCRM_Cxn_CiviCxnHttp - Expose getCache() function
Tim Otten [Mon, 18 Jun 2018 21:57:56 +0000 (14:57 -0700)]
CRM_Cxn_CiviCxnHttp - Expose getCache() function

6 years ago(dev/core#174) CRM_Utils_Cache - Always use a prefix. Standardize delimiter.
Tim Otten [Fri, 30 Mar 2018 00:36:56 +0000 (17:36 -0700)]
(dev/core#174) CRM_Utils_Cache - Always use a prefix. Standardize delimiter.

"Prefixes" are a way to have one cache-server (e.g. one instance of redis or memcached)
which stores several different data-sets. `CRM_Utils_Cache` uses prefixes in a couple ways:

* (1) General site prefix (controlled via `civicrm.settings.php`)
    * (1a) If you have a single-site deployment, then the general prefix is blank.
    * (1b) If you have a multi-site deployment, then each site should use a different prefix (`mysite_1`, `mysite_2`, etc).
* (2) Within a given deployment, prefixes may indicate different logical data-sets.
    * (2a) `Civi::cache()` or `Civi::cache('default')` or `CRM_Utils_Cache::singleton()` are the `default` data-set.
    * (2b) `CRM_Utils_Cache::create()` can instantiate new, special-purpose
      data-sets. For example, this is used for `Civi::cache('js_strings')`.

This patch addresses two issues:

 * (Functional) Flushing the 'default' cache would likely flush all other caches
   because the 'default' cache didn't have a distinctive prefix. (This was observed Redis. Theoretically,
   the bug would apply to some-but-not-all cache backends.)
 * (Aesthetic) The full cache paths don't look consistent because they don't have a standard dlimiter.

To fully understand, it helps to see example cache keys produced in a few
configurations before and after the patch.

See also: https://lab.civicrm.org/dev/core/issues/174

Before
-----------------------------

| |Deployment Type|Logical Cache  |Combined Cache Prefix |Example Cache Item (`foobar`)|
|-|-|---------------|-------|-----------------|
|1a,2a|Single-site|`default`    |(empty-string)|`foobar`|
|1a,2b|Single-site| `js_strings` |`_js_strings`|`_js_stringsfoobar`|
|1b,2a|Multi-site |`default`    |`mysite_1_`|`mysite_1_foobar`|
|1b,2b|Multi-site |`js_strings` |`mysite_1_js_strings`|`mysite_1_js_stringsfoobar`|

* If you have a single-site deployment and try to flush `default`, you
  inadvertently flush `js_strings` because everything matches the empty-string prefix.
* If you have a multi-site deployment and try to flush `default`, you
  inadvertently flush `js_strings` because the prefix overlaps.
* The three parts of the key (deployment ID, logical cache, and cache item) are not necessarily separated.

After
-----------------------------

| |Deployment Type|Logical Cache  |Combined Cache Prefix |Example Cache Item (`foobar`)|
|-|-|---------------|-------|-----------------|
|1a,2a|Single-site|`default`    |`/default/`|`/default/foobar`|
|1a,2b|Single-site|`js_strings` |`/js_strings/`|`/js_strings/foobar`|
|1b,2a|Multi-site |`default`    |`mysite_1/default/`|`mysite_1/default/foobar`|
|1b,2b|Multi-site |`js_strings` |`mysite_1/js_strings/`|`mysite_1/js_strings/foobar`|

* If you have a single-site deployment and try to flush `default`, you
  only flush `default` because the prefixes are distinct.
* If you have a multi-site deployment and try to flush `default`, you
  only flush `default` because the prefixes are distinct.
* The three parts of the key (deployment ID, logical cache, and cache item) are always separated by `/`.

Comments
--------

When developing this patch, I found it helpful to:

* Enable Redis driver
* Open `redis-cli` and view the list of cache items with `keys *`.

6 years agoFix missing quote
Coleman Watts [Tue, 19 Jun 2018 15:59:18 +0000 (11:59 -0400)]
Fix missing quote

6 years agoUse html5 color input for contribution page widget
Coleman Watts [Tue, 19 Jun 2018 15:55:25 +0000 (11:55 -0400)]
Use html5 color input for contribution page widget

6 years agoMerge pull request #12330 from totten/master-flush-prefix
Eileen McNaughton [Tue, 19 Jun 2018 08:30:56 +0000 (20:30 +1200)]
Merge pull request #12330 from totten/master-flush-prefix

(dev/core#174) CRM_Utils_Cache_Redis::flush() - Respect prefixes

6 years agoMerge pull request #12338 from seamuslee001/bootstrap_mailing_2
Seamus Lee [Tue, 19 Jun 2018 03:33:25 +0000 (13:33 +1000)]
Merge pull request #12338 from seamuslee001/bootstrap_mailing_2

Ensure classes are the same across all workflow templates

6 years agoEnsure classes are the same across all workflow templates
Seamus Lee [Tue, 19 Jun 2018 01:10:06 +0000 (11:10 +1000)]
Ensure classes are the same across all workflow templates

6 years agoMerge pull request #12270 from eileenmcnaughton/systememail
Seamus Lee [Tue, 19 Jun 2018 01:06:57 +0000 (11:06 +1000)]
Merge pull request #12270 from eileenmcnaughton/systememail

Towards CRM-17753 - consolidate code location for do-not-reply@mydomain.com

6 years agoMerge pull request #12013 from seamuslee001/button_bootstrap_classes_mailing
Seamus Lee [Tue, 19 Jun 2018 00:16:45 +0000 (10:16 +1000)]
Merge pull request #12013 from seamuslee001/button_bootstrap_classes_mailing

Add in bootstrap button classes to CiviMail interface

6 years agosystemStatusCheckResult - Migrate from settings to cache
Tim Otten [Thu, 29 Mar 2018 20:36:52 +0000 (13:36 -0700)]
systemStatusCheckResult - Migrate from settings to cache

This is fundamentally an ephemeral value. Storing this in the settings
table prevents one from accessing the system with a read-only database.

6 years agoCivi\Core\Container - Make it easier to define more named caches
Tim Otten [Thu, 29 Mar 2018 23:37:41 +0000 (16:37 -0700)]
Civi\Core\Container - Make it easier to define more named caches

6 years agoAdd in new classe to buttons in CiviMail Interface to allow them to be themed up...
Seamus Lee [Sun, 22 Apr 2018 01:45:27 +0000 (11:45 +1000)]
Add in new classe to buttons in CiviMail Interface to allow them to be themed up independantly by themes

Further remove bootstrap class infavor of namespaced class

6 years agoMerge pull request #12335 from civicrm/5.3
Eileen McNaughton [Mon, 18 Jun 2018 21:46:56 +0000 (09:46 +1200)]
Merge pull request #12335 from civicrm/5.3

5.3 merge to master

6 years agoMerge pull request #12333 from pradpnayak/185
Eileen McNaughton [Mon, 18 Jun 2018 21:09:39 +0000 (09:09 +1200)]
Merge pull request #12333 from pradpnayak/185

dev/core/issues/189, fixed smarty error

6 years agoAdd support for hidden fields in general and 'token' specifically on payment form.
eileen [Mon, 18 Jun 2018 10:19:39 +0000 (22:19 +1200)]
Add support for hidden fields in general and 'token' specifically on payment form.

It is common enough for payment processors to store a hidden token on the form that we should specifically support it. In general
the processor can add other fields of type hidden and they should show up.

6 years agoMerge pull request #12176 from vinuvarshith/dev-core-133-reply-to-check
Eileen McNaughton [Mon, 18 Jun 2018 20:12:05 +0000 (08:12 +1200)]
Merge pull request #12176 from vinuvarshith/dev-core-133-reply-to-check

dev/core/#133 Make Conditions Stricter When Checking If Reply-To Field Is Empty

6 years agodev/core/#133 Make Conditions Stricter When Checking If Reply-To Field Is Empty
varshith89 [Mon, 21 May 2018 09:08:06 +0000 (09:08 +0000)]
dev/core/#133 Make Conditions Stricter When Checking If Reply-To Field Is Empty

dev/core/#133 Retain existing behaviour on update and only be aggressive on adding new

6 years agofixed smarty error
Pradeep Nayak [Mon, 18 Jun 2018 19:07:50 +0000 (00:37 +0530)]
fixed smarty error

6 years ago(dev/core#174) CRM_Utils_Cache_Redis::flush() - Respect prefixes
Tim Otten [Fri, 30 Mar 2018 00:11:45 +0000 (17:11 -0700)]
(dev/core#174) CRM_Utils_Cache_Redis::flush() - Respect prefixes

When flushing caches for an instance of `CRM_Utils_Cache_Redis`, you should
only delete the items with the matching prefix.

For example, we have two cache services for `js_strings` and
`community_messages`.  These caches always use the same backend with
different naming/prefixes. The backend depends on the system configuration...
might be Redis, Memcache, or SqlGroup. Let's suppose the configuration is `Redis`.

To consider the before/after, it helps to have these two snippets for reference:

```
1: Civi::cache('js_strings')->flush();
2: Civi::cache('community_messages')->flush();
```

Before
------

Flushing `js_strings` has the side-effect of flushing everything
else in Redis, such as `community_messages`.

After
-----

Flushing `js_strings` only flushes `js_strings`.

Comments
--------

The example above focuses on two relatively obscure caches.  In the future,
as part of dev/core#174, it will become possible to store sessions in Redis.
And then it will be more important -- e.g.  if a user creates a custom-field,
you do want to flush one set of data (e.g. the contact-fields cache), but you
don't want to flush another (e.g. the user sessions).

The current commit fixes Redis.  Although it's outside the scope of this
commit, here's an assessment of other drivers:

* `APCcache`, `ArrayCache`, `NoCache` should be fine already.
* `SqlGroup` is sort of right, sort of not. Another patch will address that.
* `Memcache` and `Memcached` look like they have the same bug. I don't
  have these systems locally, so I haven't tried to patch.

6 years agoMerge pull request #12329 from eileenmcnaughton/master
Eileen McNaughton [Mon, 18 Jun 2018 00:28:07 +0000 (12:28 +1200)]
Merge pull request #12329 from eileenmcnaughton/master

[NFC] Stop passing no-longer-part-of-signature variable

6 years agoStop passing no-longer-part-of-signature variable
eileen [Sun, 17 Jun 2018 21:51:52 +0000 (09:51 +1200)]
Stop passing no-longer-part-of-signature variable

6 years agoMerge pull request #12313 from mattwire/CRM-21682_api_v3_membership_cleanup
Eileen McNaughton [Sun, 17 Jun 2018 21:34:14 +0000 (09:34 +1200)]
Merge pull request #12313 from mattwire/CRM-21682_api_v3_membership_cleanup

Cleanup of api_v3_membership_create towards #11556

6 years agoMerge pull request #12322 from totten/master-unused-modulepaths
Eileen McNaughton [Sun, 17 Jun 2018 21:23:38 +0000 (09:23 +1200)]
Merge pull request #12322 from totten/master-unused-modulepaths

(dev/core#174) Remove reference to unused `modulePaths`

6 years agoMerge pull request #12311 from totten/master-tmpnam
Eileen McNaughton [Sun, 17 Jun 2018 21:08:46 +0000 (09:08 +1200)]
Merge pull request #12311 from totten/master-tmpnam

(dev/core#183) Temporary tables should follow consistent naming convention

6 years agoMerge pull request #12160 from aydun/core_124_event_approval_fixes
Eileen McNaughton [Sun, 17 Jun 2018 19:44:04 +0000 (07:44 +1200)]
Merge pull request #12160 from aydun/core_124_event_approval_fixes

dev/core#124 Enhancements for events requiring approval

6 years agoMerge pull request #12323 from totten/master-flush-sig
Eileen McNaughton [Sun, 17 Jun 2018 05:43:10 +0000 (17:43 +1200)]
Merge pull request #12323 from totten/master-flush-sig

(NFC) dev/core#174 - CRM_Utils_System::flushCache - Remove dead code

6 years agoMerge pull request #12328 from civicrm/5.3
Eileen McNaughton [Sat, 16 Jun 2018 22:23:23 +0000 (10:23 +1200)]
Merge pull request #12328 from civicrm/5.3

5.3 to master

6 years agoMerge pull request #12326 from pradpnayak/185
Eileen McNaughton [Sat, 16 Jun 2018 22:22:36 +0000 (10:22 +1200)]
Merge pull request #12326 from pradpnayak/185

dev/core/issues/185 “Print selected rows” option missing in Event Participant listing dropdown actions

6 years agoMerge pull request #12324 from colemanw/ApiExporerFix
Tim Otten [Sat, 16 Jun 2018 18:51:13 +0000 (11:51 -0700)]
Merge pull request #12324 from colemanw/ApiExporerFix

Fix typo in api explorer sample code

6 years agoWrong key assigned to task action
Pradeep Nayak [Thu, 14 Jun 2018 21:55:27 +0000 (03:25 +0530)]
Wrong key assigned to task action

6 years agoFix typo in api explorer sample code
Coleman Watts [Sat, 16 Jun 2018 03:09:19 +0000 (23:09 -0400)]
Fix typo in api explorer sample code

6 years ago(NFC) dev/core#174 - CRM_Utils_System::flushCache - Remove dead code
Tim Otten [Sat, 16 Jun 2018 02:01:35 +0000 (19:01 -0700)]
(NFC) dev/core#174 - CRM_Utils_System::flushCache - Remove dead code

Before
------

* The signature of `CRM_Utils_System::flushCache` does not accept arguments.
* Random forms call it with arguments.

After
-----

* The signature of `CRM_Utils_System::flushCache` does not accept arguments.
* Random forms call it without arguments.

6 years agoCRM_Utils_SQL_TempTable - Improve docblock
Tim Otten [Sat, 16 Jun 2018 00:40:39 +0000 (17:40 -0700)]
CRM_Utils_SQL_TempTable - Improve docblock

6 years agoMerge pull request #12321 from totten/master-unused-setitem
Seamus Lee [Sat, 16 Jun 2018 00:10:14 +0000 (10:10 +1000)]
Merge pull request #12321 from totten/master-unused-setitem

(dev/core#174) api_v3_SettingTest - Remove dead code

6 years ago(dev/core#174) Remove reference to unused `modulePaths`
Tim Otten [Fri, 15 Jun 2018 23:30:41 +0000 (16:30 -0700)]
(dev/core#174) Remove reference to unused `modulePaths`

The cache-clear operation removes this setting, but the setting does not
really exist today.  (Simply grep universe for `modulePaths` to see this.)
If you dig up the JIRA reference, it talks about the internals of v4.2.
There's been a lot of change in how this stuff works since v4.2.

6 years agoMerge pull request #12314 from mattwire/CRM-21682_cleanup_recordAdditionalPayment
Eileen McNaughton [Fri, 15 Jun 2018 22:44:21 +0000 (10:44 +1200)]
Merge pull request #12314 from mattwire/CRM-21682_cleanup_recordAdditionalPayment

Cleanup recordAdditionalPayment towards #11556

6 years agoMerge pull request #12318 from mattwire/inherit_core_form_task
Eileen McNaughton [Fri, 15 Jun 2018 22:36:33 +0000 (10:36 +1200)]
Merge pull request #12318 from mattwire/inherit_core_form_task

Make all form tasks inherit from Core_Form_Task

6 years ago(dev/core#174) api_v3_SettingTest - Remove unused cache reference
Tim Otten [Fri, 15 Jun 2018 21:48:57 +0000 (14:48 -0700)]
(dev/core#174) api_v3_SettingTest - Remove unused cache reference

This unit is clearing out a non-existent cache item. To see that it is non-existent, I grepped (case-insensitive) for
the expressions:

* `CiviCRM setting Spec`
* `CiviCRM setting `
* `setting spec`

This feels like left-overs from 4.6. In 4.7, the setting cache was reworked. Note that
`SettingTest` does clear newer cache (`Civi::cache('settings')->flush();`).

6 years agoMerge pull request #12218 from mattwire/getcustomfieldid
Eileen McNaughton [Fri, 15 Jun 2018 19:01:20 +0000 (07:01 +1200)]
Merge pull request #12218 from mattwire/getcustomfieldid

dev/core#144 getCustomFieldID switch to API, add caching, add full string return option

6 years agoMerge pull request #11578 from jitendrapurohit/CRM-20697
Monish Deb [Fri, 15 Jun 2018 13:19:34 +0000 (18:49 +0530)]
Merge pull request #11578 from jitendrapurohit/CRM-20697

CRM-20697 - Online pay now anomalies (contribution transfer to new contact)

6 years agogetCustomFieldID switch to API, add caching, add full string return option.
Matthew Wire [Sun, 27 May 2018 16:10:02 +0000 (17:10 +0100)]
getCustomFieldID switch to API, add caching, add full string return option.

6 years agoMake all form task inherit from Core_Form_Task otherwise export can fail when accesse...
Matthew Wire [Fri, 1 Jun 2018 15:34:28 +0000 (16:34 +0100)]
Make all form task inherit from Core_Form_Task otherwise export can fail when accessed from advanced search because properties are inaccessible

6 years agoNFC code cleanup to core task class
Matthew Wire [Fri, 1 Jun 2018 10:53:16 +0000 (11:53 +0100)]
NFC code cleanup to core task class

6 years agoFix typo in CRM_Grant_Form_Task that prevents retrieving session key from URL
Matthew Wire [Fri, 1 Jun 2018 15:35:01 +0000 (16:35 +0100)]
Fix typo in CRM_Grant_Form_Task that prevents retrieving session key from URL

6 years agoNFC: Cleanup recordAdditionalPayment
Matthew Wire [Fri, 15 Jun 2018 07:57:53 +0000 (08:57 +0100)]
NFC: Cleanup recordAdditionalPayment

6 years agoCleanup of api_v3_membership_create towards #11556
Matthew Wire [Fri, 15 Jun 2018 07:42:42 +0000 (08:42 +0100)]
Cleanup of api_v3_membership_create towards #11556

6 years ago(dev/core#183) Change temp table naming for CRM/Contact/Form/Search/Custom/DateAdded.php
Tim Otten [Fri, 15 Jun 2018 04:31:50 +0000 (21:31 -0700)]
(dev/core#183) Change temp table naming for CRM/Contact/Form/Search/Custom/DateAdded.php

Re:`r-run` -- Verified that these lines are executed by the search form -- and
that the outcomes of a few basic searches are the same with the patch.

6 years ago(dev/core#183) Change temp table naming for CRM/Contact/Form/Search/Custom/ContribSYB...
Tim Otten [Fri, 15 Jun 2018 03:52:56 +0000 (20:52 -0700)]
(dev/core#183) Change temp table naming for CRM/Contact/Form/Search/Custom/ContribSYBNT.php

Re:`r-run` -- Verified that these lines are executed by the search form -- and
that the outcomes of a few basic searches are the same with the patch.

6 years ago(dev/core#183) Change temp table naming for CRM_Activity_BAO_Activity
Tim Otten [Fri, 15 Jun 2018 03:35:05 +0000 (20:35 -0700)]
(dev/core#183) Change temp table naming for CRM_Activity_BAO_Activity

Note: Verified that changes to this line are reflected as passes/failures in
CRM_Activity_BAO_ActivityTest.

6 years agoMerge pull request #11495 from yashodha/CRM-21637
Monish Deb [Fri, 15 Jun 2018 03:09:38 +0000 (08:39 +0530)]
Merge pull request #11495 from yashodha/CRM-21637

CRM-21637 - Search Criteria for Card Type ID and Card Number not resp…

6 years ago(dev/core#183) Change temp table naming for reports
Tim Otten [Fri, 15 Jun 2018 00:03:54 +0000 (17:03 -0700)]
(dev/core#183) Change temp table naming for reports

Testing notes - This is a pretty formulaic change.  The main concern is some kind of typo or bad table name causing a
hard-fail.  To control that risk, we just run the code in a facile way:

* Navigate to "Reports => Contributions => Lybunt"
* Add a "Filter" by "Group"

We do this procedure under a few circumstances:

* With the original code
* With a purposefully bad edit (provoking an expected error)
* With the new code

In this commit, we changed two lines, so we do the above once for each line.

6 years ago(dev/core#183) Change temp table naming for exports
Tim Otten [Thu, 14 Jun 2018 23:27:37 +0000 (16:27 -0700)]
(dev/core#183) Change temp table naming for exports

Testing notes - This is a pretty formulaic change.  The main concern is some kind of typo or bad table name causing a
hard-fail.  To control that risk, we just run the code in a facile way:

* Perform a contact search
* Pick some contacts
* Export them
* Run the export

We do this procedure under a few circumstances:

* With the original code
* With a purposefully bad edit (provoking an expected error)
* With the new code

6 years ago(dev/core#183) Change temp table naming for search-tasks
Tim Otten [Thu, 14 Jun 2018 23:18:16 +0000 (16:18 -0700)]
(dev/core#183) Change temp table naming for search-tasks

Testing notes - This is a pretty formulaic change.  The main concern is some kind of typo or bad table name causing a
hard-fail.  To control that risk, we just run the code in a facile way:

* Perform a contact search
* Pick some contacts
* Export them

We do this procedure under a few circumstances:

* With the original code
* With a purposefully bad edit (provoking an expected error)
* With the new code

6 years ago(dev/core#183) Deprecate CRM_Core_DAO::createTempTableName()
Tim Otten [Thu, 14 Jun 2018 23:48:33 +0000 (16:48 -0700)]
(dev/core#183) Deprecate CRM_Core_DAO::createTempTableName()

We're changing the naming formula, but some use-cases may rely on the old
naming formula.  Anything based on the old formula needs to be examined.