- $entity[$fieldName] = substr('New String', 0, CRM_Utils_Array::Value('maxlength', $specs, 100));
+ if ($fieldName == 'form_values' && $entity_name == 'SavedSearch') {
+ // This is a hack for the SavedSearch API. It expects form_values
+ // to be a serialized array.
+ // If you want to fix this, you should definitely read this forum
+ // post.
+ // http://forum.civicrm.org/index.php/topic,33990.0.html
+ // See also my question on the CiviCRM Stack Exchange:
+ // https://civicrm.stackexchange.com/questions/3437
+ $entity[$fieldName] = array('sort_name' => "SortName2");
+ }
+ else {
+ $entity[$fieldName] = substr('New String', 0, CRM_Utils_Array::Value('maxlength', $specs, 100));
+ }