Commit fe4802e5 authored by RaulMuroc's avatar RaulMuroc Committed by develCuy

Issue #2369713 by artmix, SimeonKesmev, RaulMuroc: Menu link path not correct on initialization

parent dc001d9c
......@@ -318,10 +318,13 @@ function menu_token_form_menu_edit_item_alter(&$form, &$form_state) {
// Replace fake path (/menutoken/ouruid) with user inputed one.
if (!empty($options['menu_token_link_path']) && !empty($options['menu_token_link_uuid'])) {
// If the input token is current-user, then return it to the fake path.
if (strpos($options['menu_token_link_path'], 'current-user') !== FALSE) {
$form['link_path']['#default_value'] = 'menutoken/' . uniqid();
}
$form['menu_token_uuid'] = array(
'#type' => 'hidden',
'#value' => substr($form['link_path']['#default_value'], 0, 10) == 'menutoken/'
? $form['link_path']['#default_value'] : '',
'#value' => $form['link_path']['#default_value'],
);
$form['link_path']['#default_value'] = $options['menu_token_link_path'];
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment