$allNull = FALSE;
}
else {
+ if (!$serializeArrays && is_array($pValue) && !empty($value['serialize'])) {
+ Civi::log()->warning(ts('use copyParams to serialize arrays (' . __CLASS__ . '.' . $name . ')'), ['civi.tag' => 'deprecated']);
+ }
$this->$dbName = $pValue;
$allNull = FALSE;
}
$hook = empty($params['id']) ? 'create' : 'edit';
CRM_Utils_Hook::pre($hook, 'MembershipBlock', CRM_Utils_Array::value('id', $params), $params);
$dao = new CRM_Member_DAO_MembershipBlock();
- $dao->copyValues($params);
+ $dao->copyValues($params, TRUE);
$dao->id = CRM_Utils_Array::value('id', $params);
$dao->save();
CRM_Utils_Hook::post($hook, 'MembershipBlock', $dao->id, $dao);
}
$instance = new CRM_Report_DAO_ReportInstance();
- $instance->copyValues($params);
+ $instance->copyValues($params, TRUE);
if (CRM_Core_Config::singleton()->userFramework == 'Joomla') {
$instance->permission = 'null';
'id' => $entity['id'],
$field => isset($entity[$field]) ? $entity[$field] : NULL,
);
+ if (!empty($specs['serialize'])) {
+ $updateParams[$field] = $entity[$field] = (array) $specs['serialize'];
+ }
if (isset($updateParams['financial_type_id']) && in_array($entityName, array('Grant'))) {
//api has special handling on these 2 fields for backward compatibility reasons
$entity['contribution_type_id'] = $updateParams['financial_type_id'];
);
$checkEntity = $this->callAPISuccess($entityName, 'getsingle', $checkParams);
+ if (!empty($specs['serialize']) && !is_array($checkEntity[$field])) {
+ // Put into serialized format for comparison if 'get' has not returned serialized.
+ $entity[$field] = CRM_Core_DAO::serializeField($checkEntity[$field], $specs['serialize']);
+ }
$this->assertAPIArrayComparison($entity, $checkEntity, array(), "checking if $fieldName was correctly updated\n" . print_r(array(
'update-params' => $updateParams,