i found a bug with the i18n module. Assume i have a node in Traditional Chinese and i edit it in English. The menu item set Menu settings will be disabled after save.
A simple workaround is to alter the node edit form such that the user will be redirected to the language same as the node.
function <module>_form_alter(&$form, $form_state, $form_id) { if(preg_match('/^.*_node_form$/', $form_id)) { // check if the backend language is the same as the node language global $language; if(isset($form['#node']) && $form['#node']->type == 'page' && $language->language != $form['#node']->language) { $node = $form['#node']; //Get the list of language objects $languages = language_list(); //Get the object and set the global $language; $language = $languages[$node->language]; //Redirection $destination = array('destination' => $_GET['destination']); unset($_GET['destination']); drupal_goto("node/{$node->nid}/edit", array('language' => $language, 'query' => $destination)); } } }
Done =)
Reference: Drupal i18n issues – Disabled menu items
Eureka! Thanks for that!
LikeLike
You are welcome. =)
LikeLike