Can I make Text Field accept filtered_html? 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 &lt;i&gt;Ike&lt;/i&gt;.

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:


https://www.drupal.org/update/modules/6/7#text_format
https://www.drupal.org/node/1087468


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(&amp;$form, &amp;$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 ' =&gt; '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 ....)
You shouldn't need to use hook_form_alter to allow the user to specify an input format for a textfield. On the content type page, you can edit a fields settings and there is an option titled "Text Processing" that you will want to use instead.



Then when I look at my node form I see the following: