civicrm/civicrm-core — pull request #1231 by totten (2013-07-24 07:21:37+00:00)
Title: CRM-12877 - Fixes for single-value alteration

testCreateSingleValue has been failing because ReportInstance::add() and ReportInstance::create() apply hard defaults to some fields. If the API caller doesn't explicitly pass in the default, then he generally intends for the field to be left alone -- but the hard-defaults will cause it to trample the existing data in the field. The changes here soften the defaults (so that they only apply to new reports).

I know this code has been refactored and may be shared with report UI code, but I don't know that code so well, so it may good for someone else to think about whether this is safe.