Problem/Motivation

Track the steps needed to deprecate extension Toolbar. See Remove a core module and move it to a contributed project of the deprecation policy.

The removal of extension Toolbar was approved in #3476882: [Policy] Move Toolbar module to contrib.

Remaining tasks

Settings Tray has a dependency on Toolbar. If Settings Tray is deprecated and moved to a contributed project before Toolbar this isn't a problem. Settings Tray in contrib can depend on Toolbar in contrib. See this comment.

  1. Find someone to maintain the contrib version of the extension. @dydave has agreed, see #21
  2. Move integrations implemented by other modules to the extension.
    Create child issues or child meta issues, as needed, to address the following points. Not all points will apply to all extensions.
  3. Do a thorough search of core for any remaining references to the extension. If references are found, outside of the extension, then create issues to remove the references.
  4. Create the contrib project with a stable release, before the alpha version of the major release. Follow the process in Create the contrib project with a stable release for creating the sub tree split.
  5. Deprecate the core extension #3560123: Deprecate the Toolbar module.
  6. #3567861: Ensure that Toolbar does not get special core treatment

Comments

quietone created an issue. See original summary.

cilefen’s picture

Title: [meta] Deprecate Toolabr module » [meta] Deprecate Toolbar module
catch’s picture

Title: [meta] Deprecate Toolbar module » [PP-1] [meta] Deprecate Toolbar module
Status: Active » Postponed

Explicitly postponing this on navigation being stable, but that is close per #3421969: [PLAN] New Navigation and Top Bar to replace Toolbar Roadmap: Path to Stable.

We will need to enable navigation in the standard profile and umami in order to actually deprecate toolbar, but there might be some other things that could happen in the meantime like making sure that no tests have explicit dependencies on it.

gábor hojtsy’s picture

#3421969-81: [PLAN] New Navigation and Top Bar to replace Toolbar Roadmap: Path to Stable onwards discusses that Settings Tray also has a hard dependency on Toolbar, however Settings Tray has such low usage that decoupling them may not be effort well spent. Should their move to contrib be handled together then?

quietone’s picture

Status: Postponed » Active

This is postponed on Navigation being stable and it is stable now that #3557578: Mark Navigation as a stable module was committed. Therefor setting this to active.

quietone’s picture

Title: [PP-1] [meta] Deprecate Toolbar module » [meta] Deprecate Toolbar module
quietone’s picture

Issue summary: View changes
quietone’s picture

quietone’s picture

Issue summary: View changes

And test usages which need to be changed.

$ git grep -E "['\"]toolbar['\"]" | grep .php | grep -v core/modules/toolbar | grep -v core/modules/ckeditor5 | grep Test | awk -F: '{print $1}' | sort -u
core/modules/announcements_feed/tests/src/Functional/AnnouncementsCacheTest.php
core/modules/announcements_feed/tests/src/FunctionalJavascript/AccessAnnouncementTest.php
core/modules/announcements_feed/tests/src/FunctionalJavascript/AlertsJsonFeedTest.php
core/modules/announcements_feed/tests/src/Kernel/AnnounceFetcherUserTest.php
core/modules/config_translation/tests/src/Functional/ConfigTranslationListUiTest.php
core/modules/contact/tests/src/Functional/ConfigTranslationListUiTest.php
core/modules/contextual/tests/src/FunctionalJavascript/ContextualLinksTest.php
core/modules/contextual/tests/src/FunctionalJavascript/EditModeTest.php
core/modules/editor/tests/src/Functional/Rest/EditorResourceTestBase.php
core/modules/editor/tests/src/Kernel/EditorValidationTest.php
core/modules/jsonapi/tests/src/Functional/EditorTest.php
core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderToolbarTest.php
core/modules/navigation/tests/src/FunctionalJavascript/PerformanceTest.php
core/modules/responsive_image/tests/src/Unit/ResponsiveImageStyleConfigEntityUnitTest.php
core/modules/shortcut/tests/src/Functional/ShortcutCacheTagsTest.php
core/modules/shortcut/tests/src/Functional/ShortcutTestBase.php
core/modules/shortcut/tests/src/Functional/ShortcutTranslationUITest.php
core/modules/shortcut/tests/src/Kernel/ShortcutCacheTagsTest.php
core/modules/system/tests/src/Functional/Menu/MenuAccessTest.php
core/modules/system/tests/src/Functional/Theme/ToolbarClaroOverridesTest.php
core/modules/system/tests/src/Functional/UpdateSystem/UpdatePathTestBaseFilledTest.php
core/modules/views_ui/tests/src/Functional/DisplayPathTest.php
core/modules/workspaces/tests/src/Functional/WorkspaceSwitcherTest.php
core/modules/workspaces/tests/src/Functional/WorkspaceTest.php
core/modules/workspaces_ui/tests/src/FunctionalJavascript/WorkspaceToolbarIntegrationTest.php
core/profiles/demo_umami/tests/src/FunctionalJavascript/OpenTelemetryAuthenticatedPerformanceTest.php
quietone’s picture

Usages of the toolbar hook

$ git grep -E "#\[Hook\('toolbar')]" | grep .php | grep -v core/modules/toolbar | grep -v core/modules/ckeditor5 | grep -v -i drupal7.php | grep -v Test
core/modules/announcements_feed/src/Hook/AnnouncementsFeedToolbarHooks.php:  #[Hook('toolbar')]
core/modules/contextual/src/Hook/ContextualHooks.php:  #[Hook('toolbar')]
core/modules/shortcut/src/Hook/ShortcutHooks.php:  #[Hook('toolbar')]
core/modules/user/src/Hook/UserHooks.php:  #[Hook('toolbar')]
core/modules/workspaces_ui/src/Hook/WorkspacesUiHooks.php:  #[Hook('toolbar')]
core/profiles/demo_umami/src/Hook/DemoUmamiHooks.php:  #[Hook('toolbar')]

And what could be the remaining

$ git grep -E "['\"]toolbar['\"]" | grep .php | grep -v core/modules/toolbar | grep -v core/modules/ckeditor5 | grep -v -i drupal7.php | grep -v Test
 | grep -v "#\[Hook"
core/modules/contextual/src/Hook/ContextualHooks.php:          ':toolbar' => \Drupal::moduleHandler()->moduleExists('toolbar') ? Url::fromRoute('help.page', [
core/modules/contextual/src/Hook/ContextualHooks.php:            'name' => 'toolbar',
core/modules/navigation/src/Hook/NavigationRequirements.php:    if ($this->moduleHandler->moduleExists('toolbar')) {
core/modules/navigation/src/Hook/NavigationRequirements.php:      $requirements['toolbar'] = [
core/modules/navigation/src/NavigationRenderer.php:    if (isset($page_top['toolbar'])) {
core/modules/navigation/src/NavigationRenderer.php:      unset($page_top['toolbar']);
core/modules/shortcut/src/Hook/ShortcutHooks.php:          ':toolbar-help' => \Drupal::moduleHandler()->moduleExists('toolbar') ? Url::fromRoute('help.page', [
core/modules/shortcut/src/Hook/ShortcutHooks.php:            'name' => 'toolbar',
core/modules/system/src/Hook/SystemHooks.php:    if ($extension === 'toolbar' && _system_is_claro_admin_and_not_active()) {
quietone’s picture

Issue summary: View changes
catch’s picture

Looks like we could tackle the things in #9 and #10 before navigation is in standard, that would mean less work to do later.

longwave’s picture

Not much we can do with #9 yet I'm afraid.

These need #3465299: Integrate Announcements module into Navigation's drawer/submenu:

core/modules/announcements_feed/tests/src/Functional/AnnouncementsCacheTest.php
core/modules/announcements_feed/tests/src/FunctionalJavascript/AccessAnnouncementTest.php
core/modules/announcements_feed/tests/src/FunctionalJavascript/AlertsJsonFeedTest.php
core/modules/announcements_feed/tests/src/Kernel/AnnounceFetcherUserTest.php

These uses can likely be removed:

core/modules/config_translation/tests/src/Functional/ConfigTranslationListUiTest.php
core/modules/contact/tests/src/Functional/ConfigTranslationListUiTest.php
core/modules/responsive_image/tests/src/Unit/ResponsiveImageStyleConfigEntityUnitTest.php
core/modules/system/tests/src/Functional/Menu/MenuAccessTest.php
core/modules/views_ui/tests/src/Functional/DisplayPathTest.php

Some parts of these test integration with contextual.module, so probably needs to be moved into toolbar.module?

core/modules/contextual/tests/src/FunctionalJavascript/ContextualLinksTest.php
core/modules/contextual/tests/src/FunctionalJavascript/EditModeTest.php

These are false positives:

core/modules/editor/tests/src/Functional/Rest/EditorResourceTestBase.php
core/modules/editor/tests/src/Kernel/EditorValidationTest.php
core/modules/jsonapi/tests/src/Functional/EditorTest.php

These need to move into toolbar.module:

core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderToolbarTest.php
core/modules/system/tests/src/Functional/Theme/ToolbarClaroOverridesTest.php

These only uninstall toolbar from standard or Umami:

core/modules/navigation/tests/src/FunctionalJavascript/PerformanceTest.php
core/profiles/demo_umami/tests/src/FunctionalJavascript/OpenTelemetryAuthenticatedPerformanceTest.php

Some parts of these test integration with shortcut.module, but that is also moving to contrib:

core/modules/shortcut/tests/src/Functional/ShortcutCacheTagsTest.php
core/modules/shortcut/tests/src/Functional/ShortcutTestBase.php
core/modules/shortcut/tests/src/Functional/ShortcutTranslationUITest.php
core/modules/shortcut/tests/src/Kernel/ShortcutCacheTagsTest.php

This needs to stay until we update the database dump:

core/modules/system/tests/src/Functional/UpdateSystem/UpdatePathTestBaseFilledTest.php

This probably needs #3511374: Core Navigation + Workspace + Workspace UI modules crashes Drupal Installation and then the toolbar tests moving to toolbar.module:

core/modules/workspaces/tests/src/Functional/WorkspaceSwitcherTest.php
core/modules/workspaces/tests/src/Functional/WorkspaceTest.php
core/modules/workspaces_ui/tests/src/FunctionalJavascript/WorkspaceToolbarIntegrationTest.php
catch’s picture

The toolbar hook implementations I think we could move all of those into the toolbar module with a moduleExists() check.

longwave’s picture

Title: [meta] Deprecate Toolbar module » [PP-1] [meta] Deprecate Toolbar module
Status: Active » Postponed

This can't be completed until #3560117: [meta] Add Navigation to the Standard profile and recipes lands, which in turn is waiting for accessibility issues in Navigation to be fixed.

It feels unlikely at this point that Toolbar will be removed from Drupal 12.

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.

berdir’s picture

Also related to toolbar: _system_is_claro_admin_and_not_active() and the 3 hooks in system module that use it, I don't know why that stuff is in system and not in toolbar, should be easy enough to move, I guess including claro_system_module_invoked_library_info_alter() in claro.theme.

andypost’s picture

I bet there's one more blocker - who is willing to maintain it in contrib

ressa’s picture

I see the Drupal 6 module https://www.drupal.org/project/toolbar, perhaps it can be Drupal core Toolbar's new home?

@dydave maintains https://www.drupal.org/project/admin_toolbar and I made him aware of this issue in #3565206: [Meta] Roadplan for Admin Toolbar 3.7, as a potential maintainer.

catch’s picture

That was originally a backport of the Drupal 7 module, makes sense to keep the namespace the same as core's.

dydave’s picture

As mentioned by my contrib partner @ressa above at #19, I've been maintaining the Admin Toolbar module for more than a year now and would certainly be interested in helping maintaining the Toolbar module if it moves over to contrib.

Feel free to add me directly as one of the maintainers, if you'd like, or please let me know if you would like me to formally apply in module's issue queue, I would be glad to do so.

Congrats everyone for all the great work and efforts getting core Navigation stabilized. 🥳

Thanks in advance! 😊

quietone’s picture

Issue summary: View changes
longwave’s picture

Running into #4 over at #3575909: Remove the Settings Tray dependency on Toolbar - settings tray doesn't really work without toolbar, looks like we either need to make settings tray work with Navigation instead, or remove settings tray as well.

berdir’s picture

The toolbar/claro stuff in system module is fully moved to toolbar module in #3579899: Remove remaining claro.theme functions, but we likely need a follow-up to that to clean up a few things around that such as hardcoded core/themes/claro paths (this will not prevent removing toolbar, but it will need to fixed eventually before claro is moved)

quietone’s picture

Status: Postponed » Active
quietone’s picture

Title: [PP-1] [meta] Deprecate Toolbar module » [meta] Deprecate Toolbar module
quietone’s picture

Title: [meta] Deprecate Toolbar module » [meta] Tasks to deprecate Toolbar module
quietone’s picture

Issue summary: View changes
quietone’s picture

Issue summary: View changes
gábor hojtsy’s picture

Issue summary: View changes