Fix failure to copy custom fields & add test provided by Agileware
authoreileen <emcnaughton@wikimedia.org>
Thu, 2 May 2019 02:19:50 +0000 (14:19 +1200)
committereileenmcnaugton <eileen@fuzion.co.nz>
Mon, 6 May 2019 20:34:24 +0000 (08:34 +1200)
commit3fec1adc393f63bb7acc9d51ec43716f4d987b9d
treed78d516db583f2061efa9459f8aebf6ffc608dff
parent0938c0f94207ba6f228b9fb2f9f9a9665e49ee0e
Fix failure to copy custom fields & add test provided by Agileware

Per https://github.com/civicrm/civicrm-core/pull/13470 custom fields are
inconsistently copied where copying entities. This makes the code from
BAO_Event called from the genericCopy function.

I did a bit of an audit and the places where this is currently called from don't appear
to call the copyGeneric function with the 'custom' param that would have activated the old
code. I also consistently removed the & when it was being called so I could take it
out of the signature.

The original PR handled tags as well, but not in a generic way. I've left that out of scope
but the test is present, commented out, so it would be easy enough to revist
CRM/Contribute/BAO/ContributionPage.php
CRM/Core/BAO/Job.php
CRM/Core/BAO/Location.php
CRM/Core/BAO/UFGroup.php
CRM/Core/DAO.php
CRM/Event/BAO/Event.php
CRM/Price/BAO/PriceSet.php
tests/phpunit/CRM/Core/BAO/RecurringEntityTest.php