I have a content type where a field is the common name for a USA president. In examing a legacy database I'm importing some presidents have (simple) HTML in their name. For example Dwight Eisenhower <i>Ike</i>
.
I would like to support this on a content type field field_people_common_name
which is a textfield
created in the Field UI.
Following these directions:
I've created a simple form alter hook to allow the input format of filtered_html
on this form element:
function prez_people_form_people_node_form_alter(&$form, &$form_state, $form_id) {
dpm($form);
$form['field_people_common_name']['und'][0]['value']['#type'] = 'text_format';
$form['field_people_common_name']['und'][0]['value']['#base_type'] = 'textfield';
$form['field_people_common_name']['und'][0]['value']['#format'] = 'filtered_html';
$form['field_people_common_name']['und'][0]['value']['#settings'] = array('text_processing ' => '1');
}
This appears to well, work or function:
But upon previewing the edit I get these errors:
Warning: mb_strlen() expects parameter 1 to be string, array given in drupal_strlen() (line 482 of ../htdocs/includes/unicode.inc). Warning: htmlspecialchars() expects parameter 1 to be string, array given in check_plain() (line 1583 of ../htdocs/includes/bootstrap.inc). Warning: htmlspecialchars() expects parameter 1 to be string, array given in check_plain() (line 1583 of ../htdocs/includes/bootstrap.inc).
Any idea how to get this to work. I'm trying to avoid embedding a text_area
for simple textfield value (a name will never require a massive textarea .... yes I know I could make the textarea 1 row tall ....)