'varchar', 'length' => 12, 'not null' => TRUE, 'default' => LANGUAGE_NONE); $schema['menu_links']['fields']['i18n_tsid'] = array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0); $schema['menu_custom']['fields']['language'] = array('type' => 'varchar', 'length' => 12, 'not null' => TRUE, 'default' => LANGUAGE_NONE); $schema['menu_custom']['fields']['i18n_mode'] = array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0); } /** * Update menu items language field from Drupal 6 */ function i18n_menu_update_7000() { // @todo } /** * Set alter property for menu items with language. */ function i18n_menu_update_7001() { // Compile a list of menus with i18n options. $i18n_menus = array_filter(menu_get_names(), 'i18n_menu_mode'); if ($i18n_menus) { $query = db_select('menu_links', 'm') ->fields('m') ->condition('menu_name', $i18n_menus); foreach ($query->execute()->fetchAllAssoc('mlid', PDO::FETCH_ASSOC) as $mlid => $item) { $options = unserialize($item['options']); if (_i18n_menu_link_check_alter($item) && empty($options['alter'])) { $options['alter'] = TRUE; db_update('menu_links') ->condition('mlid', $mlid) ->fields(array('options' => serialize($options))) ->execute(); } } } }