When translate menu item - copy default values from original menu item to newly created

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

stubben’s picture

yingtho’s picture

Status: Active » Needs review
yingtho’s picture

Fix warning when attributes when menu has no attributes.

joelpittet’s picture

Version: 7.x-1.0-rc2 » 7.x-1.x-dev
Status: Needs review » Postponed (maintainer needs more info)

Can you explain what this patch is doing? Sorry but I don't follow the goal of this patch.

MediaFormat’s picture

It seems to copy the attributes, if any, when a menu item is translated to another language.

joelpittet’s picture

Status: Postponed (maintainer needs more info) » Needs work

Thanks @MediaFormat I see what you mean.

+++ b/menu_attributes.module
@@ -214,6 +214,16 @@ function _menu_attributes_form_alter(array &$form, array $item = array(), array
+  if (isset($_GET['translation'])) {
+    $source_item = menu_link_load($_GET['translation']);

Can we avoid checking the _GET argument?

Maybe this should be done on form submission for creating a new translation?