By default, content synchronised through CMIS SYNC is set with a body_format of NULL, so any HTML tags are always displayed when rendering the field, even if the default format for that field is set to something like 'Filtered HTML'.

Either this module should respect these default field settings, or there should be arguments to support automatically setting this body format setting to a particular format.

As a quick workaround, the following code will set all loaded content to 'Filtered HTML' for all field types ''

// cmis_sync/cmis_sync.drupal.inc line 280
$node->$field_name = array();
$node->{$field_name}['und'][0]['value'] = $field_value;
// modification begins here
if ($fields[$field_name]['widget']['type'] === 'text_textarea_with_summary') {
  $node->{$field_name}['und'][0]['format'] = 'filtered_html';
// modification ends here
}

This could be set in settings.php as a specific format for each synchronised field, and/or a global default format for specific widget types, etc.

Comments

RMani’s picture

How does it work with drupal 7's cmis
line 280 is not the same
its like
$note->$field_value;

please help
regards,
Rekha

RMani’s picture

thank you i figured it out ... it was in the defaults of the case statements

IanNorton’s picture

Assigned: Unassigned » IanNorton
Status: Active » Closed (fixed)

I've pushed a fix for this, technically Drupal's doing what it is supposed to as no filter value was specified it uses the default defined in a variable (see variable_get('filter_fallback_format');)

I've added a TODO to allow this to be configured on a field sync basis, right now filtered_html is a happy in-between.

IanNorton’s picture

Fixed in latest dev code release, also this issue is a duplicate of 1463370

soundasleep’s picture

I've proposed a patch to allow configurable text formats for each field in http://drupal.org/node/1932658.