Problem/Motivation

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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

timcosgrove’s picture

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.