From 3845201ec7e5b5eaeaebab2084d3be3dc5b9b006 Mon Sep 17 00:00:00 2001 From: Jens Beltofte Date: Mon, 18 Nov 2013 15:54:16 +0100 Subject: [PATCH 01/15] Fixing undefined variable notice. Fixing "Notice: Undefined variable: watchdog_rows in _os2web_esdh_provider_status()". --- os2web_esdh_provider.admin.inc | 1 + 1 file changed, 1 insertion(+) diff --git a/os2web_esdh_provider.admin.inc b/os2web_esdh_provider.admin.inc index 728b131..bae55d4 100644 --- a/os2web_esdh_provider.admin.inc +++ b/os2web_esdh_provider.admin.inc @@ -34,6 +34,7 @@ function _os2web_esdh_provider_status() { // Show a table of watchdog entries if the debug flag is on. $watchdog_table = ''; if (variable_get('os2web_esdh_provider_debug_info')) { + $watchdog_rows = array(); $watchdog_messages = db_query('SELECT * FROM {watchdog} w WHERE w.type = :type AND w.severity = :severity ORDER BY w.timestamp DESC', array(':type' => 'acadre MM', ':severity' => WATCHDOG_WARNING)); $watchdog_head = array(t('Warning messages in descending order'), t('Date')); foreach ($watchdog_messages as $row) { From 8ed2248fb7bb80a15fb7d0bbc35b7ed7725c795c Mon Sep 17 00:00:00 2001 From: Jens Beltofte Date: Mon, 18 Nov 2013 22:34:08 +0100 Subject: [PATCH 02/15] Adding support for transliteration in sanetizing of file names. --- os2web_esdh_provider.mmapi.inc | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/os2web_esdh_provider.mmapi.inc b/os2web_esdh_provider.mmapi.inc index 59aa98d..f83b806 100644 --- a/os2web_esdh_provider.mmapi.inc +++ b/os2web_esdh_provider.mmapi.inc @@ -564,15 +564,20 @@ function _os2web_esdh_provider_node_tab_page($nid, $op = FALSE) { * Sanetized filename with same extension. */ function _os2web_esdh_provider_sanetize_filename($filename) { - // Replace whitespace. - // $filename = str_replace(' ', '_', $filename); - // Remove remaining unsafe characters. - // $filename = preg_replace('![^0-9A-Za-z_.- ]!', '', $filename); - $filename = preg_replace('![/"]!', '-', $filename); - // Remove multiple consecutive non-alphabetical characters. - $filename = preg_replace('/(_)_+|(\.)\.+|(-)-+/', '\\1\\2\\3', $filename); - // Force lowercase to prevent issues on case-insensitive file systems. - // $filename = strtolower($filename); + if (module_exists('transliteration')) { + $filename = transliteration_clean_filename($filename); + } + else { + // Replace whitespace. + // $filename = str_replace(' ', '_', $filename); + // Remove remaining unsafe characters. + // $filename = preg_replace('![^0-9A-Za-z_.- ]!', '', $filename); + $filename = preg_replace('![/"]!', '-', $filename); + // Remove multiple consecutive non-alphabetical characters. + $filename = preg_replace('/(_)_+|(\.)\.+|(-)-+/', '\\1\\2\\3', $filename); + // Force lowercase to prevent issues on case-insensitive file systems. + // $filename = strtolower($filename); + } $pi = pathinfo($filename); if (isset($pi['extension'])) { return substr(trim($pi['filename']), 0, 160) . '.' . $pi['extension']; From 617c4cc5f6cad1afcbb052e42e9a8b8a2ca89cbd Mon Sep 17 00:00:00 2001 From: Jens Beltofte Date: Mon, 23 Dec 2013 18:26:05 +0100 Subject: [PATCH 03/15] Adding support for term duplicate check on the committee ID field on the taxonomy terms. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The solution is backward compatible and is not locked to the committee vocabulary. “$term_name” can be provided as an array with the keys esdh_name (The term name), esdh_id (the term ID from the ESDH system) and esdh_id_field (the field machine name used to store the ID on the taxonomy term e.g. field_os2web_meetings_commiteeid). The FICS integration is using this to avoid problems with committees with the same name, and to allow automatically renaming of committees directly from FICS. --- os2web_esdh_provider.mmapi.inc | 55 ++++++++++++++++++++++++++-------- 1 file changed, 42 insertions(+), 13 deletions(-) diff --git a/os2web_esdh_provider.mmapi.inc b/os2web_esdh_provider.mmapi.inc index f83b806..fed1bd8 100644 --- a/os2web_esdh_provider.mmapi.inc +++ b/os2web_esdh_provider.mmapi.inc @@ -147,7 +147,8 @@ function _os2web_esdh_provider_import_meeting($meeting_id, $force = FALSE, &$con # Setting the new title with committee name and meeting date substring $my_date = date_create(substr($meeting['meeting_date_start'], 0,10)); $format = "d-m-Y"; - $node->title = $meeting['committee'] . ' - ' . date_format($my_date,$format); + $committee_name = is_array($meeting['committee']) ? $meeting['committee']['esdh_name'] : $meeting['committee']; + $node->title = $committee_name . ' - ' . date_format($my_date,$format); # adding the alias and setting pathauto to 0 for this content type. otherwise we get 2 aliases. $path_alias = array( @@ -160,7 +161,6 @@ function _os2web_esdh_provider_import_meeting($meeting_id, $force = FALSE, &$con $node->path = $path_alias; } - $node->field_os2web_meetings_abbr[LANGUAGE_NONE][0]['value'] = substr($meeting['description'], 0, 49); // If field has a format, you need to define it. Here we define a default filtered_html format for a body field. $node->field_os2web_meetings_abbr[LANGUAGE_NONE][0]['format'] = 'filtered_html'; @@ -459,8 +459,10 @@ function _os2web_esdh_provider_import_file($file_meta) { /** * Imports a termname into a vacabulary. Does dupe check. * - * @param string $term_name - * Term machine name + * @param mixed $term_name + * Term name, or array containing term name and ESDH ID for + * the term. + * * @param string $vocab * Vocabulary machine name * @@ -468,30 +470,57 @@ function _os2web_esdh_provider_import_file($file_meta) { * Drupal standard Term object */ function _acadre_esdh_import_term($term_name, $vocab) { + // Some MM plugins provide both term name and the ESDH ID for the + // term. The latter makes it possible to handle multiple terms with + // same name and automatically updating of term names based on data + // from the ESDH system. + if (is_array($term_name)) { + $term_esdh_id = $term_name['esdh_id']; + $term_esdh_id_field = $term_name['esdh_id_field']; + $term_name = $term_name['esdh_name']; + } err_debug('Start import term'); // TODO: Process members of the committee. // FIXME: MAke vocab name configurable. $vid = db_select('taxonomy_vocabulary', 'tv') - ->fields('tv', array('vid')) - ->condition('machine_name', $vocab) - ->execute() - ->fetchField(); + ->fields('tv', array('vid')) + ->condition('machine_name', $vocab) + ->execute() + ->fetchField(); $term = new stdClass(); $term->vid = $vid; $term->name = $term_name; - $tid = db_select('taxonomy_term_data', 'td') - ->fields('td', array('tid')) - ->condition('name', $term->name) - ->condition('vid', $term->vid) - ->execute()->fetchObject(); + // Searching for an existing term based on the provided ESDH ID. + if (!empty($term_esdh_id_field) && !empty($term_esdh_id) && $term_esdh_id > 0) { + $term->{$term_esdh_id_field}[und][0][value] = $term_esdh_id; + + $query = new EntityFieldQuery(); + $result = $query->entityCondition('entity_type', 'taxonomy_term') + ->propertyCondition('vid', $vid) + ->fieldCondition($term_esdh_id_field, 'value', $term_esdh_id, '=') + ->execute(); + if (isset($result['taxonomy_term'])) { + $tid = array_shift($result['taxonomy_term']); + } + } + // If no ESDH ID is provided are we falling back and selecting on the + // term name. + else if (!empty($tid)) { + $tid = db_select('taxonomy_term_data', 'td') + ->fields('td', array('tid')) + ->condition('name', $term->name) + ->condition('vid', $term->vid) + ->execute()->fetchObject(); + } if (isset($tid->tid) && $tid->tid > 0) { $term->tid = (int) $tid->tid; } + taxonomy_term_save($term); return $term; From 4368f74d448760cda4435f62252445d6692fb6a3 Mon Sep 17 00:00:00 2001 From: Jens Beltofte Date: Sun, 29 Dec 2013 18:53:03 +0100 Subject: [PATCH 04/15] Making adlib support optional. --- README.md | 2 +- os2web_esdh_provider.info | 1 - os2web_esdh_provider.mmapi.inc | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 3d9fc4d..96407c0 100644 --- a/README.md +++ b/README.md @@ -8,8 +8,8 @@ publishing service. Uses Adlib service to convert files to pdf. Dependencies ----------- -- os2web_adlib_api - ctools +- features Configuration ----------- diff --git a/os2web_esdh_provider.info b/os2web_esdh_provider.info index e2adf2a..41fd650 100644 --- a/os2web_esdh_provider.info +++ b/os2web_esdh_provider.info @@ -7,5 +7,4 @@ version = 7.x-1.0-beta1 project = os2web_esdh_provider dependencies[] = ctools dependencies[] = features -dependencies[] = os2web_adlib_api features[features_api][] = api:1 diff --git a/os2web_esdh_provider.mmapi.inc b/os2web_esdh_provider.mmapi.inc index fed1bd8..ee563b5 100644 --- a/os2web_esdh_provider.mmapi.inc +++ b/os2web_esdh_provider.mmapi.inc @@ -443,7 +443,7 @@ function _os2web_esdh_provider_import_file($file_meta) { // Schedule for PDF conversion // $convert = FALSE; // DEBUG. - if ($convert) { + if ($convert && module_exists('os2web_adlib_api')) { drupal_load('module', 'os2web_adlib_api'); os2web_adlib_api_convert_to_pdf($file->fid, $file->filename); watchdog('os2web_adlib_api', 'File %filename (fid: %fid) queued for PDF conversion.', array( From 8ef14836df739dd08c4518d5dee21020ec6e9594 Mon Sep 17 00:00:00 2001 From: Jens Beltofte Date: Tue, 21 Jan 2014 16:59:24 +0100 Subject: [PATCH 05/15] Enabling republishing of meetings + fixing notices from bullets not being an array Making it possible to enable republishing of meetings from the MM plugin by defining and setting the constant MM_REPUBLISH_MEETINGS. --- os2web_esdh_provider.mmapi.inc | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/os2web_esdh_provider.mmapi.inc b/os2web_esdh_provider.mmapi.inc index ee563b5..755b05d 100644 --- a/os2web_esdh_provider.mmapi.inc +++ b/os2web_esdh_provider.mmapi.inc @@ -90,10 +90,8 @@ function _os2web_esdh_provider_import_meeting($meeting_id, $force = FALSE, &$con // Meeting already exist. // Either republish, delete or skip. if ($nid) { - - if ($force) { + if ($force || (defined('MM_REPUBLISH_MEETINGS') && MM_REPUBLISH_MEETINGS)) { err_debug('Republish nid: ' . $nid); - $node = node_load($nid); watchdog('acadre MM', 'Using %nid for import.', array('%nid' => $nid), WATCHDOG_DEBUG); } @@ -204,11 +202,13 @@ function _os2web_esdh_provider_import_meeting($meeting_id, $force = FALSE, &$con } // Delete all bullet points before importing. - $bullets = array_shift($node->field_os2web_meetings_bullets); - if (is_array($bullets)) { - $nids_to_delete = array(); - foreach ($bullets as $nids) { - $nids_to_delete[$nids['target_id']] = $nids['target_id']; + if (is_array($node->field_os2web_meetings_bullets)) { + $bullets = array_shift($node->field_os2web_meetings_bullets); + if (is_array($bullets)) { + $nids_to_delete = array(); + foreach ($bullets as $nids) { + $nids_to_delete[$nids['target_id']] = $nids['target_id']; + } } } @@ -496,7 +496,7 @@ function _acadre_esdh_import_term($term_name, $vocab) { // Searching for an existing term based on the provided ESDH ID. if (!empty($term_esdh_id_field) && !empty($term_esdh_id) && $term_esdh_id > 0) { - $term->{$term_esdh_id_field}[und][0][value] = $term_esdh_id; + $term->{$term_esdh_id_field}['und'][0]['value'] = $term_esdh_id; $query = new EntityFieldQuery(); $result = $query->entityCondition('entity_type', 'taxonomy_term') From 63719b8377975dd7f037bd6d275d5dad03a0b022 Mon Sep 17 00:00:00 2001 From: Jens Beltofte Date: Tue, 21 Jan 2014 17:42:52 +0100 Subject: [PATCH 06/15] Adding $force and $focus variables to invoking of get_import_list. This is need in FICS version of get_import_list to avoid listing all XML files every time. --- os2web_esdh_provider.admin.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/os2web_esdh_provider.admin.inc b/os2web_esdh_provider.admin.inc index bae55d4..0d9ac33 100644 --- a/os2web_esdh_provider.admin.inc +++ b/os2web_esdh_provider.admin.inc @@ -161,7 +161,7 @@ function _os2web_esdh_provider_status_confirm_submit($form, &$form_state) { 'file' => drupal_get_path('module', 'os2web_esdh_provider') . '/os2web_esdh_provider.mmapi.inc', 'init_message' => t('Scanner filer'), ); - $meetings = os2web_esdh_provider_invoke('mm', 'get_import_list'); + $meetings = os2web_esdh_provider_invoke('mm', 'get_import_list', $force, $focus); foreach ($meetings as $meeting) { if (empty($focus) || in_array($meeting['id'], $focus)) { $batch['operations'][] = array( From de0938953a2e17560488b93b3027fc7692437e44 Mon Sep 17 00:00:00 2001 From: Vitaliy Sekan Date: Thu, 23 Jan 2014 18:20:11 +0200 Subject: [PATCH 07/15] dont create aliases --- os2web_esdh_provider.mmapi.inc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/os2web_esdh_provider.mmapi.inc b/os2web_esdh_provider.mmapi.inc index 755b05d..1f41222 100644 --- a/os2web_esdh_provider.mmapi.inc +++ b/os2web_esdh_provider.mmapi.inc @@ -137,7 +137,8 @@ function _os2web_esdh_provider_import_meeting($meeting_id, $force = FALSE, &$con # skifter@bellcom.dk - 2013-04-14 / 2013-04-24 # is the pathauto module loades ? - if (module_exists('pathauto')) { + // Don't create aliases (vitaliy.sekan@propeople.com.ua) + if (module_exists('pathauto') && FALSE) { # Loading the path auto modules module_load_include('inc', 'pathauto', 'pathauto'); @@ -764,4 +765,4 @@ function _os2web_esdh_provider_bpa_body_format() { } } return $cache; -} \ No newline at end of file +} From 23e5d99f32849415cbe30b1896cb411d3b31f2b9 Mon Sep 17 00:00:00 2001 From: Jens Beltofte Date: Tue, 28 Jan 2014 16:22:16 +0100 Subject: [PATCH 08/15] Making it configurable to disable the MM path auto implementation instead of just disabling it. --- os2web_esdh_provider.mmapi.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/os2web_esdh_provider.mmapi.inc b/os2web_esdh_provider.mmapi.inc index 1f41222..98895fa 100644 --- a/os2web_esdh_provider.mmapi.inc +++ b/os2web_esdh_provider.mmapi.inc @@ -138,7 +138,7 @@ function _os2web_esdh_provider_import_meeting($meeting_id, $force = FALSE, &$con # is the pathauto module loades ? // Don't create aliases (vitaliy.sekan@propeople.com.ua) - if (module_exists('pathauto') && FALSE) { + if (module_exists('pathauto') && !(defined('MN_DISABLE_PATHAUTO') && MN_DISABLE_PATHAUTO)) { # Loading the path auto modules module_load_include('inc', 'pathauto', 'pathauto'); From 843e86a37184394f5672bda9f6e6c6d1ae9a5f9a Mon Sep 17 00:00:00 2001 From: Jens Beltofte Date: Tue, 28 Jan 2014 16:34:54 +0100 Subject: [PATCH 09/15] Adding support for disabling the file URI scheme. --- os2web_esdh_provider.mmapi.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/os2web_esdh_provider.mmapi.inc b/os2web_esdh_provider.mmapi.inc index 98895fa..06944d3 100644 --- a/os2web_esdh_provider.mmapi.inc +++ b/os2web_esdh_provider.mmapi.inc @@ -415,7 +415,7 @@ function _os2web_esdh_provider_import_file($file_meta) { return FALSE; } - if (file_uri_scheme($uri) != 'public') { + if (!(defined('MM_USE_ALTERNATIVE_FILE_URI_SCHEME') && MM_USE_ALTERNATIVE_FILE_URI_SCHEME) && file_uri_scheme($uri) != 'public') { watchdog('acadre MM', 'Invalid scheme for uri %uri, Possibly absolut path ? ' . $uri, array( '%uri', $uri), WATCHDOG_ERROR); error_log("Var: \$uri = " . print_r($uri, 1)); From 3f2b6218feea35448a897dd516754dfd9324ce5f Mon Sep 17 00:00:00 2001 From: Vitaliy Sekan Date: Wed, 29 Jan 2014 12:39:01 +0200 Subject: [PATCH 10/15] Get the meetings list in right moment --- os2web_esdh_provider.module | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/os2web_esdh_provider.module b/os2web_esdh_provider.module index f03fa30..fbbe000 100644 --- a/os2web_esdh_provider.module +++ b/os2web_esdh_provider.module @@ -170,10 +170,9 @@ function os2web_esdh_provider_node_delete($node) { */ function os2web_esdh_provider_cron() { if (os2web_esdh_provider_has_api('mm')) { - $meetings = os2web_esdh_provider_invoke('mm', 'get_import_list'); $queue = DrupalQueue::get('acadre_mm_import'); if ($queue->numberOfItems() == 0) { - + $meetings = os2web_esdh_provider_invoke('mm', 'get_import_list'); $current_timestamp = time(); $last_mm_import_time = variable_get('os2web_esdh_provider_last_mm_import', FALSE); From 98ddca25cb513b5207b0f0372686f8f644eeaec9 Mon Sep 17 00:00:00 2001 From: Vitaliy Sekan Date: Tue, 11 Feb 2014 12:53:29 +0200 Subject: [PATCH 11/15] Fixed duplicated taxonomy terms creation --- os2web_esdh_provider.mmapi.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/os2web_esdh_provider.mmapi.inc b/os2web_esdh_provider.mmapi.inc index 06944d3..67458c0 100644 --- a/os2web_esdh_provider.mmapi.inc +++ b/os2web_esdh_provider.mmapi.inc @@ -510,7 +510,7 @@ function _acadre_esdh_import_term($term_name, $vocab) { } // If no ESDH ID is provided are we falling back and selecting on the // term name. - else if (!empty($tid)) { + else { $tid = db_select('taxonomy_term_data', 'td') ->fields('td', array('tid')) ->condition('name', $term->name) From ee3558db3608e9199b66433436b025b849bb13bb Mon Sep 17 00:00:00 2001 From: Vitaliy Sekan Date: Tue, 10 Jun 2014 16:28:13 +0300 Subject: [PATCH 12/15] modules distination --- os2web_esdh_provider.make | 2 ++ 1 file changed, 2 insertions(+) diff --git a/os2web_esdh_provider.make b/os2web_esdh_provider.make index 4463042..a02b733 100644 --- a/os2web_esdh_provider.make +++ b/os2web_esdh_provider.make @@ -16,11 +16,13 @@ core = 7.x # projects[os2web_print_send_to_friend][download][url] = "https://github.com/OS2web/os2web_print_send_to_friend.git" projects[os2web_esdh_field][type] = "module" +projects[os2web_esdh_field][subdir] = contrib projects[os2web_esdh_field][download][type] = "git" projects[os2web_esdh_field][download][branch] = "master" projects[os2web_esdh_field][download][url] = "https://github.com/OS2web/os2web_esdh_field.git" projects[os2web_adlib_api][type] = "module" +projects[os2web_adlib_api][subdir] = contrib projects[os2web_adlib_api][download][type] = "git" projects[os2web_adlib_api][download][branch] = "master" projects[os2web_adlib_api][download][url] = "https://github.com/OS2web/os2web_adlib_api.git" From 8b3ed931450c3c298cdd7c32595e393691065d1b Mon Sep 17 00:00:00 2001 From: jakobdo Date: Wed, 11 Jun 2014 14:13:40 +0200 Subject: [PATCH 13/15] Update os2web_esdh_provider.mmapi.inc Got this notice in error report: Notice: Undefined property: stdClass::$field_os2web_meetings_bullets in _os2web_esdh_provider_import_meeting() (line 206 of /var/www/drupal-7.28/sites/all/modules/custom/os2web_esdh_provider/os2web_esdh_provider.mmapi.inc). --- os2web_esdh_provider.mmapi.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/os2web_esdh_provider.mmapi.inc b/os2web_esdh_provider.mmapi.inc index 67458c0..eb5952c 100644 --- a/os2web_esdh_provider.mmapi.inc +++ b/os2web_esdh_provider.mmapi.inc @@ -203,7 +203,7 @@ function _os2web_esdh_provider_import_meeting($meeting_id, $force = FALSE, &$con } // Delete all bullet points before importing. - if (is_array($node->field_os2web_meetings_bullets)) { + if(property_exists($node,'field_os2web_meetings_bullets') && is_array($node->field_os2web_meetings_bullets)) { $bullets = array_shift($node->field_os2web_meetings_bullets); if (is_array($bullets)) { $nids_to_delete = array(); From cc3e936671061d80521047ef093c25ad51149b09 Mon Sep 17 00:00:00 2001 From: jakobdo Date: Mon, 23 Jun 2014 14:53:34 +0200 Subject: [PATCH 14/15] Update os2web_esdh_provider.mmapi.inc --- os2web_esdh_provider.mmapi.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/os2web_esdh_provider.mmapi.inc b/os2web_esdh_provider.mmapi.inc index 67458c0..eb5952c 100644 --- a/os2web_esdh_provider.mmapi.inc +++ b/os2web_esdh_provider.mmapi.inc @@ -203,7 +203,7 @@ function _os2web_esdh_provider_import_meeting($meeting_id, $force = FALSE, &$con } // Delete all bullet points before importing. - if (is_array($node->field_os2web_meetings_bullets)) { + if(property_exists($node,'field_os2web_meetings_bullets') && is_array($node->field_os2web_meetings_bullets)) { $bullets = array_shift($node->field_os2web_meetings_bullets); if (is_array($bullets)) { $nids_to_delete = array(); From 773d5ab25625e6d93b3efa6163ea4efc26e4d19a Mon Sep 17 00:00:00 2001 From: jakobdo Date: Tue, 7 Oct 2014 10:24:24 +0200 Subject: [PATCH 15/15] Update os2web_esdh_provider.mmapi.inc Handle Unicode in description --- os2web_esdh_provider.mmapi.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/os2web_esdh_provider.mmapi.inc b/os2web_esdh_provider.mmapi.inc index eb5952c..04cae02 100644 --- a/os2web_esdh_provider.mmapi.inc +++ b/os2web_esdh_provider.mmapi.inc @@ -160,7 +160,7 @@ function _os2web_esdh_provider_import_meeting($meeting_id, $force = FALSE, &$con $node->path = $path_alias; } - $node->field_os2web_meetings_abbr[LANGUAGE_NONE][0]['value'] = substr($meeting['description'], 0, 49); + $node->field_os2web_meetings_abbr[LANGUAGE_NONE][0]['value'] = mb_substr($meeting['description'], 0, 49); // If field has a format, you need to define it. Here we define a default filtered_html format for a body field. $node->field_os2web_meetings_abbr[LANGUAGE_NONE][0]['format'] = 'filtered_html'; // The date.