Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 192-168-1-5:drupal8 admin$ git remote
- origin
- 192-168-1-5:drupal8 admin$ git fetch origin
- 192-168-1-5:drupal8 admin$
- 192-168-1-5:drupal8 admin$
- 192-168-1-5:drupal8 admin$ git status
- # On branch 8.x
- nothing to commit, working directory clean
- 192-168-1-5:drupal8 admin$
- 192-168-1-5:drupal8 admin$
- 192-168-1-5:drupal8 admin$ git merge origin
- Already up-to-date.
- 192-168-1-5:drupal8 admin$
- 192-168-1-5:drupal8 admin$ git checkout -b 1945226-menu-language-selector-b
- Switched to a new branch '1945226-menu-language-selector-b'
- 192-168-1-5:drupal8 admin$ pwd
- /Users/admin/drupal8
- 192-168-1-5:drupal8 admin$ curl -O http://drupal.org/files/drupal-1945226-Add-language-selector-on-menus-3.patch
- % Total % Received % Xferd Average Speed Time Time Time Current
- Dload Upload Total Spent Left Speed
- 100 3801 100 3801 0 0 3177 0 0:00:01 0:00:01 --:--:-- 8191
- 192-168-1-5:drupal8 admin$ git apply drupal-1945226-Add-language-selector-on-menus-3.patch
- 192-168-1-5:drupal8 admin$
- 192-168-1-5:drupal8 admin$ git status
- # On branch 1945226-menu-language-selector-b
- # Changes not staged for commit:
- # (use "git add <file>..." to update what will be committed)
- # (use "git checkout -- <file>..." to discard changes in working directory)
- #
- # modified: core/modules/menu/lib/Drupal/menu/MenuFormController.php
- #
- # Untracked files:
- # (use "git add <file>..." to include in what will be committed)
- #
- # sites/default/files/
- # sites/default/settings.php
- no changes added to commit (use "git add" and/or "git commit -a")
- 192-168-1-5:drupal8 admin$ git diff
- diff --git a/core/modules/menu/lib/Drupal/menu/MenuFormController.php b/core/modules/menu/lib/Drupal/menu/MenuFormController.php
- index ff42a20..e229451 100644
- --- a/core/modules/menu/lib/Drupal/menu/MenuFormController.php
- +++ b/core/modules/menu/lib/Drupal/menu/MenuFormController.php
- @@ -63,6 +63,31 @@ public function form(array $form, array &$form_state, EntityInterface $menu) {
- $form['links'] = menu_overview_form($form['links'], $form_state);
- }
- + // $form['langcode'] is not wrapped in an if (module_exists('language'))
- + // check because the language_select form element works also without the
- + // language module being installed.
- + // http://drupal.org/node/1749954 documents the new element.
- + $form['langcode'] = array(
- + '#type' => 'language_select',
- + '#title' => t('Menu language'),
- + '#languages' => LANGUAGE_ALL,
- + '#default_value' => $menu->langcode,
- + );
- + if (module_exists('language')) {
- + $form['default_menu_items_language'] = array(
- + '#type' => 'details',
- + '#title' => t('Menu items language'),
- + );
- + $form['default_menu_items_language']['default_language'] = array(
- + '#type' => 'language_configuration',
- + '#entity_information' => array(
- + 'entity_type' => 'menu_item',
- + 'bundle' => $menu->id(),
- + ),
- + '#default_value' => language_get_default_configuration('menu_item', $menu->id()),
- + );
- + }
- +
- return $form;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement