Menu Attributes provides hook_menu_attributes_info to allow additional Form API elements to be included for saving within menu item options. This includes text_format Form API elements. However, text_format saves its value/format combination in the format

$text_format_value = array(
  'value' => $text_value,
  'format' => $text_format,

_menu_attributes_form_alter() does not account for this structure when setting the #default_value of its form elements, and so the saved text_format value/format combination is not loaded correctly into the form.

Proposed resolution

The attached patch has handling for the default value of text_format form elements.

#1 menu_attributes-text_format_handling-1971288-1.patch869 bytestimcosgrove
PASSED: [[SimpleTest]]: [MySQL] 108 pass(es). View
menu_attributes_text_format_handling.patch869 bytestimcosgrove
PASSED: [[SimpleTest]]: [MySQL] 108 pass(es). View
Members fund testing for the Drupal project. Drupal Association Learn more


timcosgrove’s picture

869 bytes
PASSED: [[SimpleTest]]: [MySQL] 108 pass(es). View

Patch renamed according to issue number.

shanethehat’s picture

Status: Active » Needs review
shanethehat’s picture

Issue summary: View changes

Spelling correction.

joelpittet’s picture

Issue summary: View changes
Status: Needs review » Postponed (maintainer needs more info)

This is a simple enough patch, thank you. Just need a bit more information on this. Can you provide the use case for when this is needed? That way we know what problem it will help solve and maybe can add a test to make sure it keeps on being solved going forward.

joelpittet’s picture

Status: Postponed (maintainer needs more info) » Closed (outdated)

This has been waiting for a response for a while, closing to triage the queue. Feel free to reopen if there is a use-case that I'm missing/don't understand.