diff --git a/composer.lock b/composer.lock index 53bbfb9ddadbe17c611ba783712253f78b723282..bac7957e6d4a43e234e0c01e0c00a4acaef3bd6e 100644 --- a/composer.lock +++ b/composer.lock @@ -5783,20 +5783,20 @@ }, { "name": "drupal/menu_breadcrumb", - "version": "1.7.0", + "version": "1.12.0", "source": { "type": "git", "url": "https://git.drupalcode.org/project/menu_breadcrumb.git", - "reference": "8.x-1.7" + "reference": "8.x-1.12" }, "dist": { "type": "zip", - "url": "https://ftp.drupal.org/files/projects/menu_breadcrumb-8.x-1.7.zip", - "reference": "8.x-1.7", - "shasum": "998c7908bd411afe745f91c725b39483e6dd693f" + "url": "https://ftp.drupal.org/files/projects/menu_breadcrumb-8.x-1.12.zip", + "reference": "8.x-1.12", + "shasum": "661512d420697e83242c7134cc945258fd531ee0" }, "require": { - "drupal/core": "~8.0" + "drupal/core": "^8 || ^9" }, "type": "drupal-module", "extra": { @@ -5804,8 +5804,8 @@ "dev-1.x": "1.x-dev" }, "drupal": { - "version": "8.x-1.7", - "datestamp": "1539197280", + "version": "8.x-1.12", + "datestamp": "1581496466", "security-coverage": { "status": "covered", "message": "Covered by Drupal's security advisory policy" @@ -5845,7 +5845,7 @@ "description": "Create breadcrumbs from nested menu titles and/or taxonomy membership.", "homepage": "https://www.drupal.org/project/menu_breadcrumb", "support": { - "source": "http://cgit.drupalcode.org/menu_breadcrumb" + "source": "https://git.drupalcode.org/project/menu_breadcrumb" } }, { diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index 88ade6e93df50df99ee613da7dc3e2c242f144e8..c230e9d4a0405106991c5079b044c4342f9dc1aa 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -5963,21 +5963,21 @@ }, { "name": "drupal/menu_breadcrumb", - "version": "1.7.0", - "version_normalized": "1.7.0.0", + "version": "1.12.0", + "version_normalized": "1.12.0.0", "source": { "type": "git", "url": "https://git.drupalcode.org/project/menu_breadcrumb.git", - "reference": "8.x-1.7" + "reference": "8.x-1.12" }, "dist": { "type": "zip", - "url": "https://ftp.drupal.org/files/projects/menu_breadcrumb-8.x-1.7.zip", - "reference": "8.x-1.7", - "shasum": "998c7908bd411afe745f91c725b39483e6dd693f" + "url": "https://ftp.drupal.org/files/projects/menu_breadcrumb-8.x-1.12.zip", + "reference": "8.x-1.12", + "shasum": "661512d420697e83242c7134cc945258fd531ee0" }, "require": { - "drupal/core": "~8.0" + "drupal/core": "^8 || ^9" }, "type": "drupal-module", "extra": { @@ -5985,8 +5985,8 @@ "dev-1.x": "1.x-dev" }, "drupal": { - "version": "8.x-1.7", - "datestamp": "1539197280", + "version": "8.x-1.12", + "datestamp": "1581496466", "security-coverage": { "status": "covered", "message": "Covered by Drupal's security advisory policy" @@ -6027,7 +6027,7 @@ "description": "Create breadcrumbs from nested menu titles and/or taxonomy membership.", "homepage": "https://www.drupal.org/project/menu_breadcrumb", "support": { - "source": "http://cgit.drupalcode.org/menu_breadcrumb" + "source": "https://git.drupalcode.org/project/menu_breadcrumb" } }, { diff --git a/web/modules/menu_breadcrumb/README.txt b/web/modules/menu_breadcrumb/README.txt index 8b1b8fe27e266e7592ffe5cca896c4b457319f55..ea24b8ae24b1773fd8e0e5ee9e0540fc11276d2a 100644 --- a/web/modules/menu_breadcrumb/README.txt +++ b/web/modules/menu_breadcrumb/README.txt @@ -8,7 +8,7 @@ The Drupal 7 version of this module implemented the Drupal 6 behaviour of using the menu position of the current page for the breadcrumb. It also added an option to append the page title to the breadcrumb (either as a clickable url or not), saving the trouble of doing this in the theme, -and hiding the breadcrumb if it only contains the link to the front page. +and hiding the breadcrumb if it only contained the link to the front page. The Drupal 8 version also supports "Taxonomy Attachment" for each menu, which provides the same breadcrumb trail to the current @@ -22,23 +22,39 @@ add the current page title, linked or not, as an additional breadcrumb when a taxonomy attachment has taken place. More detailed options are given for dealing with the front page, allowing it to be added or removed. -Installation ------------- +Installation & Upgrading - RECOMMENDED +-------------------------------------- +Follow current instructions on this Drupal documentation page +to install Menu Breadcrumb as a site dependency and upgrade it +along with other site dependencies (as well as Drupal Core itself): + +https://www.drupal.org/docs/develop/using-composer/using-composer-to-manage-drupal-site-dependencies + +IF YOU SEE AN ERROR PAGE similar to the following after up- or down-grading the module: + +TypeError: Argument <X> passed to Drupal\menu_breadcrumb\MenuBasedBreadcrumbBuilder::__construct() ... + +... you probably just need to rebuild the cache between two versions that use +different argument lists (i.e. system services). See here for how to rebuild cache: + +https://www.drupal.org/docs/user_guide/en/prevent-cache-clear.html + +Installation & Upgrading - without Composer +------------------------------------------- + +Installation, on older Drupal versions & sites: 1. Copy the menu_breadcrumb folder to your modules/contrib directory. 2. At Administer -> Extend (admin/modules) enable the module. 3. Configure the module settings at Administer -> Configuration -> User Interface (admin/config/user-interface/menu-breadcrumb). -Upgrading ---------- +Upgrading on older Drupal versions & sites: Recommended: install drush and run "drush up" Manually: replace the older menu_breadcrumb folder with the newer version; then run "update.php" if present (to install any configuration changes). -NOTES if you have installed a Drupal 8 development version: -If upgrading from the Alpha to the Beta version of the module, or to a -newer Beta, if option settings are not producing the desired effect: +Since different versions of the module may use different services, if you see errors: - Try clearing the cache, which fixes breacrumb on taxonomy pages (since this module's breadcrumb builder needs to be acknolwedged as higher priority). diff --git a/web/modules/menu_breadcrumb/config/install/menu_breadcrumb.settings.yml b/web/modules/menu_breadcrumb/config/install/menu_breadcrumb.settings.yml index 9387c5ba5463423ee610f97d6dae65e10af8547a..38cff6d618040436002e378cc5151b5415367dcc 100644 --- a/web/modules/menu_breadcrumb/config/install/menu_breadcrumb.settings.yml +++ b/web/modules/menu_breadcrumb/config/install/menu_breadcrumb.settings.yml @@ -2,14 +2,14 @@ determine_menu: true disable_admin_page: true append_current_page: true current_page_as_link: false +stop_on_first_match: false append_member_page: false member_page_as_link: false remove_home: false add_home: false -home_as_site_name: false +front_title: 0 exclude_empty_url: false -# as of Beta, this option is obsolete: -# hide_on_single_item: false +derived_active_trail: false menu_breadcrumb_menus: main: enabled: 1 diff --git a/web/modules/menu_breadcrumb/config/schema/menu_breadcrumb.schema.yml b/web/modules/menu_breadcrumb/config/schema/menu_breadcrumb.schema.yml index 5dbbc9009bea61b513e53859dd33e53d711abb17..73ba426f664ff3d5b2d00391f2f8881f5fd3c2a9 100644 --- a/web/modules/menu_breadcrumb/config/schema/menu_breadcrumb.schema.yml +++ b/web/modules/menu_breadcrumb/config/schema/menu_breadcrumb.schema.yml @@ -14,6 +14,9 @@ menu_breadcrumb.settings: current_page_as_link: type: boolean label: 'If the current page in the breadcrumb trail should be a link.' + stop_on_first_match: + type: boolean + label: 'End the breadcrumb trail when the first matching found in the menu.' append_member_page: type: boolean label: 'This option affects breadcrumb display when the current page is a member of a taxonomy whose term is on a menu with "Taxonomy Attachment" selected.' @@ -26,12 +29,15 @@ menu_breadcrumb.settings: add_home: type: boolean label: 'Ensure that the very first link is the designated <front> page link.' - home_as_site_name: - type: boolean - label: 'Use the site name from the configuration settings.' + front_title: + type: integer + label: 'Choose how to show home title in breadcrumb' exclude_empty_url: type: boolean label: 'Exclude menu items with empty URLs.' + derived_active_trail: + type: boolean + label: 'Derive MenuActiveTrail from RouteMatch.' menu_breadcrumb_menus: type: sequence label: 'Menu Breadcrumb Menu Configurations' diff --git a/web/modules/menu_breadcrumb/menu_breadcrumb.info.yml b/web/modules/menu_breadcrumb/menu_breadcrumb.info.yml index a828765403a897b15144d6aefa2299d9410559c2..620fdd694b5f0997c5393af17d0c2ff1b355cb2b 100644 --- a/web/modules/menu_breadcrumb/menu_breadcrumb.info.yml +++ b/web/modules/menu_breadcrumb/menu_breadcrumb.info.yml @@ -1,11 +1,11 @@ name: Menu Breadcrumb type: module description: 'Create breadcrumbs from nested menu titles and/or taxonomy membership.' -# core: '8.x' +core: '8.x' +core_version_requirement: ^8 || ^9 configure: menu_breadcrumb.settings -# Information added by Drupal.org packaging script on 2018-10-10 -version: '8.x-1.7' -core: '8.x' +# Information added by Drupal.org packaging script on 2020-02-12 +version: '8.x-1.12' project: 'menu_breadcrumb' -datestamp: 1539197292 +datestamp: 1581496469 diff --git a/web/modules/menu_breadcrumb/menu_breadcrumb.install b/web/modules/menu_breadcrumb/menu_breadcrumb.install new file mode 100644 index 0000000000000000000000000000000000000000..4793ddc770cc239298b6985efa57afb2004ddad3 --- /dev/null +++ b/web/modules/menu_breadcrumb/menu_breadcrumb.install @@ -0,0 +1,32 @@ +<?php + +/** + * @file + * Install, update and uninstall functions for the menu breadcrumb module. + */ + +/** + * Set new front_title config key from home_as_site_name. + */ +function menu_breadcrumb_update_8101() { + $config = \Drupal::configFactory()->getEditable('menu_breadcrumb.settings'); + + $home_as_site_name = $config->get('home_as_site_name'); + // We suppose that if home_as_site_name is null it is because the settings + // form had been resaved or a custom update path had been done on the website. + if (!is_null($home_as_site_name)) { + // If the front_title key has already been set, do nothing. + if (is_null($config->get('front_title'))) { + if ($home_as_site_name == FALSE) { + $config->set('front_title', 1); + } + else { + $config->set('front_title', 0); + } + } + + // Remove the previous key. + $config->clear('home_as_site_name'); + $config->save(TRUE); + } +} diff --git a/web/modules/menu_breadcrumb/menu_breadcrumb.module b/web/modules/menu_breadcrumb/menu_breadcrumb.module index bb82e8a07edd89c851c1856c516e4e9929a9b8d0..5cfaa5a53f8d8939b3fc46d567e11d6f7e913176 100644 --- a/web/modules/menu_breadcrumb/menu_breadcrumb.module +++ b/web/modules/menu_breadcrumb/menu_breadcrumb.module @@ -28,7 +28,7 @@ function menu_breadcrumb_help($route_name, RouteMatchInterface $route_match) { <ul> <li> If the "Taxonomy Attachment" option is selected for a menu, -and if the current page belongs to a taxonomy that is on that menu, +and if the current page belongs to a taxonomy on that menu, it will inherit the taxonomy page's menu breadcrumbs (e.g., to provide breadcrumbs for blog entries that aren't on menus themselves). </li> @@ -65,15 +65,15 @@ function menu_breadcrumb_help($route_name, RouteMatchInterface $route_match) { Taxonomy terms are searched in the order that their entity reference fields appear in the current page's field listing. One way to change an unwanted taxonomy term taking precendence over the one -you want to "attach" on would be to change the order of those fields. +on which you want to "attach" would be to change the order of those fields. </p> <p> -When the current page is displaying the breadcrumbs of its taxonomy parent, +When the current page displays the breadcrumbs of its taxonomy parent, the breadcrumb for that taxonomy is <u>always</u> a link regardless of the "Show current page as link" option. (This can be confusing until we remember that this breadcrumb <u>is not</u> for the current page, and must be a link because the current page is no anchored at all in the menu… unlike a -breacrumb that isn't taxonomy-attached.) +breadcrumb that isn't taxonomy-attached.) </p> EOT; break; @@ -83,7 +83,7 @@ function menu_breadcrumb_help($route_name, RouteMatchInterface $route_match) { $output = <<<EOT <p> Select the first option to enable the Menu Breadcrumb module, -which will generate a breadcrumb trail the first match +which will generate a breadcrumb trail according to the first match in the selected menu below: first looking for the current page on a menu (unless avoiding that menu due to language settings), and then seeing if the current page belongs to a taxonomy on that menu diff --git a/web/modules/menu_breadcrumb/menu_breadcrumb.services.yml b/web/modules/menu_breadcrumb/menu_breadcrumb.services.yml index f1cc4e3a71c42452b714750f19af1b295f9d2557..7d0702d3c58ab12d73c8b5955d961eac7ef4182d 100644 --- a/web/modules/menu_breadcrumb/menu_breadcrumb.services.yml +++ b/web/modules/menu_breadcrumb/menu_breadcrumb.services.yml @@ -1,7 +1,7 @@ services: menu_breadcrumb.breadcrumb.default: class: Drupal\menu_breadcrumb\MenuBasedBreadcrumbBuilder - arguments: ['@config.factory', '@menu.active_trail', '@plugin.manager.menu.link', '@router.admin_context', '@title_resolver', '@request_stack', '@language_manager', '@entity_type.manager'] + arguments: ['@config.factory', '@menu.active_trail', '@plugin.manager.menu.link', '@router.admin_context', '@title_resolver', '@request_stack', '@language_manager', '@entity_type.manager', '@cache.menu', '@lock'] tags: # The priority must be higher than core taxonomy builder (priority: 1002) # see https://www.drupal.org/node/1495510 diff --git a/web/modules/menu_breadcrumb/src/Form/SettingsForm.php b/web/modules/menu_breadcrumb/src/Form/SettingsForm.php index 53e82400808837e07757e039ff6abc6577b62d0c..23058274d0d931b363dcb9eb31c646d3df0b0430 100644 --- a/web/modules/menu_breadcrumb/src/Form/SettingsForm.php +++ b/web/modules/menu_breadcrumb/src/Form/SettingsForm.php @@ -59,7 +59,6 @@ protected function getEditableConfigNames() { */ public function buildForm(array $form, FormStateInterface $form_state) { $config = $this->config('menu_breadcrumb.settings'); - // Renamed from the now meaningless option "determine_menu": $form['determine_menu'] = [ '#type' => 'checkbox', '#title' => $this->t('Enable the Menu Breadcrumb module'), @@ -95,10 +94,17 @@ public function buildForm(array $form, FormStateInterface $form_state) { ], ]; + $form['stop_on_first_match'] = [ + '#type' => 'checkbox', + '#title' => $this->t('Stop on the first matching'), + '#description' => $this->t('End the breadcrumb trail when the first matching found in the menu.'), + '#default_value' => $config->get('stop_on_first_match'), + ]; + $form['append_member_page'] = [ '#type' => 'checkbox', '#title' => $this->t('Attach taxonomy member page to breadcrumb'), - '#description' => $this->t('This option affects breadcrumb display when the current page is a member of a taxonomy whose term is on a menu with "Taxonomy Attachment" selected, when it "attaches" to the menu-based breadcrumbs of that taxonomy term. In this case that term\'s menu title will show as a link regardless of the "current page" options above. Set this option TRUE to also show the the current ("attached") <i>page</i> title as the final breadcrumb.'), + '#description' => $this->t('This option affects breadcrumb display when the current page is a member of a taxonomy whose term is on a menu with "Taxonomy Attachment" selected, when it "attaches" to the menu-based breadcrumbs of that taxonomy term. In this case that term\'s menu title will show as a link regardless of the "current page" options above. Set this option TRUE to also show the current ("attached") <i>page</i> title as the final breadcrumb.'), '#default_value' => $config->get('append_member_page'), ]; @@ -114,12 +120,6 @@ public function buildForm(array $form, FormStateInterface $form_state) { ], ]; - // Removed option "hide_on_single_item" - makes no sense when the taxonomy - // attachment feature is added, especially now that this module reverts to - // other breadcrumb builders (e.g., the path-based system breadcrumb) when - // it doesn't apply (can be reconsidered if there is a valid use case). - // $form['hide_on_single_item'] ... - // $form['remove_home'] = [ '#type' => 'checkbox', '#title' => $this->t('Remove "Home" link'), @@ -134,11 +134,15 @@ public function buildForm(array $form, FormStateInterface $form_state) { '#description' => $this->t('If TRUE will add a link to the <front> page if it doesn\'t already begin the breadcrumb trail: ensuring that the first breadcrumb of every page is the site home. If both "add" and "remove" are set, when displaying the <front> page and its menu children the "remove" option will take precedence.'), ]; - $form['home_as_site_name'] = [ - '#type' => 'checkbox', - '#title' => $this->t('Use site name instead of "Home" link'), - '#description' => $this->t('Uses the site name from the configuration settings: if this option is not set, a translated value for "Home" will be used.'), - '#default_value' => $config->get('home_as_site_name'), + $form['front_title'] = [ + '#type' => 'radios', + '#title' => $this->t('Home title'), + '#default_value' => $config->get('front_title'), + '#options' => [ + 0 => $this->t('Use "Home" as title'), + 1 => $this->t('Uses the site name from the configuration settings: if this option is not set, a translated value for "Home" will be used.'), + 2 => $this->t('Use title menu parent'), + ], ]; $form['exclude_empty_url'] = [ @@ -148,6 +152,13 @@ public function buildForm(array $form, FormStateInterface $form_state) { '#default_value' => $config->get('exclude_empty_url'), ]; + $form['derived_active_trail'] = [ + '#type' => 'checkbox', + '#title' => $this->t('Derive MenuActiveTrail from RouteMatch'), + '#description' => $this->t('If FALSE, the injected @menu.active_trail service will be used. If you have a multilingual site with unusually large menus, see <a target="_blank" href="https://www.drupal.org/project/menu_breadcrumb/issues/3083028">issue 3083028</a>.'), + '#default_value' => $config->get('derived_active_trail'), + ]; + $form['include_exclude'] = [ '#type' => 'fieldset', '#title' => $this->t('Enable / Disable Menus'), @@ -206,10 +217,6 @@ public function buildForm(array $form, FormStateInterface $form_state) { ], ]; } - // Removed description of a "Default setting" selection which was never - // implemeneted in the current D8 version of Menu Breadcrumb. - // TODO perhaps find out if this option would be worth preserving - // (applied to default tick boxes for new menus added in the future). return parent::buildForm($form, $form_state); } @@ -222,13 +229,15 @@ public function submitForm(array &$form, FormStateInterface $form_state) { ->set('disable_admin_page', (boolean) $form_state->getValue('disable_admin_page')) ->set('append_current_page', (boolean) $form_state->getValue('append_current_page')) ->set('current_page_as_link', (boolean) $form_state->getValue('current_page_as_link')) + ->set('stop_on_first_match', (boolean) $form_state->getValue('stop_on_first_match')) ->set('append_member_page', (boolean) $form_state->getValue('append_member_page')) ->set('member_page_as_link', (boolean) $form_state->getValue('member_page_as_link')) - ->set('home_as_site_name', (boolean) $form_state->getValue('home_as_site_name')) + ->set('front_title', $form_state->getValue('front_title')) ->set('remove_home', (boolean) $form_state->getValue('remove_home')) ->set('add_home', (boolean) $form_state->getValue('add_home')) ->set('menu_breadcrumb_menus', $form_state->getValue('menu_breadcrumb_menus')) ->set('exclude_empty_url', $form_state->getValue('exclude_empty_url')) + ->set('derived_active_trail', $form_state->getValue('derived_active_trail')) ->save(); parent::submitForm($form, $form_state); diff --git a/web/modules/menu_breadcrumb/src/MenuBasedBreadcrumbBuilder.php b/web/modules/menu_breadcrumb/src/MenuBasedBreadcrumbBuilder.php index 315ad43c813a29b238b8b4d29bd5f728635913c0..3c8904899106f1baa9c531e4de63fc8b8c9c7c55 100644 --- a/web/modules/menu_breadcrumb/src/MenuBasedBreadcrumbBuilder.php +++ b/web/modules/menu_breadcrumb/src/MenuBasedBreadcrumbBuilder.php @@ -5,6 +5,7 @@ use Drupal\Component\Utility\SortArray; use Drupal\Core\Breadcrumb\Breadcrumb; use Drupal\Core\Breadcrumb\BreadcrumbBuilderInterface; +use Drupal\Core\Cache\CacheBackendInterface; use Drupal\Core\Config\ConfigFactoryInterface; use Drupal\Core\Controller\TitleResolverInterface; use Drupal\Core\Entity\EntityTypeManagerInterface; @@ -13,6 +14,8 @@ use Drupal\Core\Language\LanguageInterface; use Drupal\Core\Language\LanguageManagerInterface; use Drupal\Core\Link; +use Drupal\Core\Lock\LockBackendInterface; +use Drupal\Core\Menu\MenuActiveTrail; use Drupal\Core\Menu\MenuActiveTrailInterface; use Drupal\Core\Menu\MenuLinkManagerInterface; use Drupal\Core\Routing\AdminContext; @@ -84,6 +87,20 @@ class MenuBasedBreadcrumbBuilder implements BreadcrumbBuilderInterface { */ protected $entityTypeManager; + /** + * The caching backend. + * + * @var \Drupal\Core\Cache\CacheBackendInterface + */ + protected $cacheMenu; + + /** + * The locking backend. + * + * @var \Drupal\Core\Lock\LockBackendInterface + */ + protected $lock; + /** * The Menu Breadcrumbs configuration. * @@ -130,7 +147,9 @@ public function __construct( TitleResolverInterface $title_resolver, RequestStack $request_stack, LanguageManagerInterface $language_manager, - EntityTypeManagerInterface $entity_type_manager + EntityTypeManagerInterface $entity_type_manager, + CacheBackendInterface $cache_menu, + LockBackendInterface $lock ) { $this->configFactory = $config_factory; $this->menuActiveTrail = $menu_active_trail; @@ -140,6 +159,8 @@ public function __construct( $this->currentRequest = $request_stack->getCurrentRequest(); $this->languageManager = $language_manager; $this->entityTypeManager = $entity_type_manager; + $this->cacheMenu = $cache_menu; + $this->lock = $lock; $this->config = $this->configFactory->get('menu_breadcrumb.settings'); } @@ -202,7 +223,17 @@ public function applies(RouteMatchInterface $route_match) { } } - $trail_ids = $this->menuActiveTrail->getActiveTrailIds($menu_name); + if ($this->config->get('derived_active_trail')) { + // Do not use the global MenuActiveTrail service because we need one + // which is aware of the given routeMatch, not of the global one. + $menuActiveTrail = new MenuActiveTrail($this->menuLinkManager, $route_match, $this->cacheMenu, $this->lock); + $trail_ids = $menuActiveTrail->getActiveTrailIds($menu_name); + } + else { + // Default, for the majority & compatibility with historical use and + // other modules: use the global (injected) MenuActiveTrail service. + $trail_ids = $this->menuActiveTrail->getActiveTrailIds($menu_name); + } $trail_ids = array_filter($trail_ids); if ($trail_ids) { $this->menuName = $menu_name; @@ -226,7 +257,7 @@ public function applies(RouteMatchInterface $route_match) { $route_links = $this->menuLinkManager->loadLinksByRoute($url->getRouteName(), $url->getRouteParameters(), $menu_name); if (!empty($route_links)) { // Successfully found taxonomy attachment, so pass to build(): - // - the menu in in which we have found the attachment + // - the menu in which we have found the attachment // - the effective menu trail of the taxonomy-attached node // - the node itself (in build() we will find its title & URL) $taxonomy_term_link = reset($route_links); @@ -281,6 +312,11 @@ public function build(RouteMatchInterface $route_match) { continue; } + // Stop items when the first url matching occurs. + if ($this->config->get('stop_on_first_match') && $plugin->getUrlObject()->toString() == Url::fromRoute('<current>')->toString()) { + break; + } + $links[] = Link::fromTextAndUrl($plugin->getTitle(), $plugin->getUrlObject()); $breadcrumb->addCacheableDependency($plugin); // In the last line, MenuLinkContent plugin is not providing cache tags. @@ -297,7 +333,7 @@ public function build(RouteMatchInterface $route_match) { // Create a breadcrumb for <front> which may be either added or replaced: $langcode = $this->contentLanguage; - $label = $this->config->get('home_as_site_name') ? + $label = $this->config->get('front_title') ? $this->configFactory->get('system.site')->get('name') : $this->t('Home', [], ['langcode' => $langcode]); // (https://www.drupal.org/docs/develop/standards/coding-standards#array) @@ -322,7 +358,7 @@ public function build(RouteMatchInterface $route_match) { if ($this->config->get('remove_home')) { array_shift($links); } - else { + elseif ($this->config->get('front_title') != 2) { $links[0] = $home_link; } } @@ -364,7 +400,7 @@ protected function addMissingCurrentPage(array &$links, RouteMatchInterface $rou $last_url->getRouteName() === $route_match->getRouteName() && $last_url->getRouteParameters() === $route_match->getRawParameters()->all() ) { - // We already have a link, no need to add one. + // We already have a link, so no need to add one. return; } }